Within a MakeDocJr Editor regular expression (in the Regex to find
field), the following characters
have special meaning:
^ |
matches the start of the document | |
$ |
matches at the end of the document | |
\A |
matches the start of the document | |
\Z |
matches at the end of the document | |
\b |
matches at a word break | |
\B |
matches at a non-word break (opposite of \b) |
. |
matches any single character | |
\d |
matches any decimal digit | |
\D |
matches any non-digit | |
\n |
matches a newline character | |
\r |
matches a return character (use \n instead) | |
\s |
matches any whitespace character | |
\S |
matches any non-whitespace character | |
\t |
matches a horizontal tab character | |
\w |
matches any word (alphanumeric) character | |
\W |
matches any non-word (alphanumeric) character | |
\x |
matches the character x, if x is not one of the above listed escape sequences. |
[abc] |
matches any character in the set a, b or c | |
[^abc] |
matches any character not in the set a, b or c | |
[a-z] |
matches any character in the range a to z, inclusive (note: a leading or trailing dash will be interpreted literally.) |
(abc) |
matches whatever the expression abc would match, and saves it as a subexpression. Also used for grouping. | |
(?:...) |
pure grouping operator, does not save contents | |
(?#...) |
embedded comment, ignored by engine | |
\n |
where 0 < n < 10, matches the same thing the n |
a|b |
matches whatever the expression a would match, or whatever the expression b would match. |
These symbols operate on the previous atomic expression.
? |
matches the preceding expression or the null string | |
* |
matches the null string or any number of repetitions of the preceding expression | |
+ |
matches one or more repetitions of the preceding expression | |
{m} |
matches exactly m repetitions of the one-character expression | |
{m,n} |
matches between m and n repetitions of the preceding expression, inclusive | |
{m,} |
matches m or more repetitions of the preceding expression |
If a repeating operator (above) is immediately followed by a ?
, the repeating operator will stop
at the smallest number of repetitions that can complete the rest of the match.
Lookahead refers to the ability to match part of an expression without consuming any of the input text. There are two variations to this:
(?=foo) |
matches at any position where foo would match, but does not consume any characters of the input. | |
(?!foo) |
matches at any position where foo would not match, but does not consume any characters of the input. |
Within a MakeDocJr Editor replacement expression (in the Replace with
field), the following characters
have special meaning:
$n |
where 0 < n < 10, includes the nth subexpression of the regex in the replacement text |
Open regexsyntax.html
and add your notes here.