Regex: List of Metacharacters
Positioning, Special characters, Lazy, Greedy, Lookahead, Lookbehind, etc.
|Beginning of line|
|End of line|
|Beginning of string|
|End of string|
|End of string (excluding line endings)|
$ are used as "beginning and end of line" but this is the case in multiline mode (usually this is the default). In single-line mode, it is the beginning or end of the entire string.
(space, tab, neewline and new page)
(alphanumeric characters plus "_")
Wildcards and repetition (quantity specifiers)
|Any one character (excluding line feed code)|
|1 character/group immediately preceding 0 or more times|
|1 character/group immediately preceding 1 or more times|
|1 character/group immediately preceding 0 or 1 times|
|1 character/group immediately preceding n times|
|1 character/group immediately preceding n or more times|
|1 character/group immediately preceding n or more times, but not more than m times.|
Match the longest part that matches the condition. Preference is given to matching the entire pattern.
Match the shortest part that matches the condition.
Match the longest part that matches the condition. No preference is given to matching the entire pattern.
(*) "^.*+" matches all "abcXdefX", so the last `X` does not match.
|Or (one character)|
(abc, mno, or xyz)
|Include metacharacters in candidates|
(abcXXX, mXo, xz, etc.)
|Combine with other strings|
(abcX, mnoX, or xyzX)
|Combine with quantity specifiers|
(abcabc, mnoabcxyz, etc.)
|Simple (a, b, or c)|
|Negation (Other than a, b, c)|
|Or (a to z or A to Z)|
|And (a to z and d to f)|
|Subtraction (a to z excluding d to f)|
Lookahead and Lookbehind
|Positive lookahead||Matches "foo" followed by "bar".|
|Negative lookahead||Matches "foo" not followed by "bar".|
|Positive lookbehind||Matches "foo" preceded by "bar".|
|Negative lookbehind||Matches "foo" not preceded by "bar".|