diff --git a/regex b/regex new file mode 100644 index 0000000..9f18009 --- /dev/null +++ b/regex @@ -0,0 +1,20 @@ +--- +tags: [ patterns ] +--- + +? match 0..1 characters or patterns (`?` must be escaped in GNU sed BRE) +* match 0..more characters or patterns ++ match 1..more characters or patterns (`+` must be escaped in GNU sed BRE) + +{} match `count` characters or patterns (`{` and `}` must be escaped in GNU sed BRE) +{} match `from`..`to` characters or patterns (`{` and `}` must be escaped in GNU sed BRE) + +[] match any mentioned character +[^] match any not mentioned character + +# We don't distinguish between single char patterns below and complex patterns: + +^ match the beggining of a string +$ match the end of a string + +(|) match any of two patterns (`|` must be escaped in GNU sed BRE)