Regular expressions

Character
Meaning
^
Matches the beginning of the string. For example:
str ? * "^abc" matches str starting with abc
$
Matches the end of the string. For example:
str ? * "abc$" matches values of str ending with abc
.
Matches any single character. For example:
str ? * "a.c$" matches values of str containing abc, axc, etc
*
Matches zero or more of the immediately preceding expression. For example:
str ? * "ab*c$" matches values of str containing ac, abc, abbc, etc
+
Matches one or more of the immediately preceding expression. For example:
str ? * "a+c$" matches values of str containing abc, abbc, agggc, but not ac
?
Matches zero or one of the immediately preceding expression. For example:
str ? * "ab?c" matches values of str containing ac or abc
|
Matches either the preceding or following expression.
For example:
str ? * "a|b|c" matches values of str containing a, b, or c
[ ]
Matches any single character listed between brackets.
For example:
str ? * "[ab]c" matches values of str containing ac or bc
[^ ]
This combination of characters matches any single character not listed between brackets. For example:
str ? * "a[^b]c" matches values of str containing axc for any replacement of x except for b
\
Escapes the character which immediately follows. For example:
str ? * "a\.c$" matches values of str containing a.c, and str ? * "a\\c$" matches values of str containing a\c
To embed a backslash character in a string, the string literal must contain two consecutive backslashes.
( )
Delimits subexpressions. For example:
str ? * "a(b|c)*d*" matches values of str containing a followed by any number of b’s or c’s followed by d, such as "ad" or "acbbccd"

Feedback