Basic Regular Expressions
Match characters:
. : matches any single character.
[]: matches characters within a specified range
[::] : Character Set
[: space:] Space character
[: Lower:] Lowercase Letters
[: Upper:] Uppercase Letters
[: Alpha:] uppercase and lowercase letters
[:d igit:] Digital
[: alnum:] numbers and uppercase and lowercase letters
[^]: matches a character outside a specified range
Number of matches:
* : matches the preceding character of the symbol any time.
.* : matches any character any time.
\?: match its first character 1 Times or 0 times.
Location anchoring:
^ : The character followed must be at the beginning of the line.
$: the preceding character must be at the end of the line.
^$: blank line.
\b or \< : The character followed must be the word header.
\b or \>: The preceding character must be the tail of the word.
Group:
\(\): group content as a whole, can appear any time eg: \ (root\)
back reference:
\ 1: The first opening parenthesis and the corresponding closing parenthesis contain the contents.
\2: ....
\3: ....
Extending regular Expressions
Character Matching:
. :
[] :
[::]:
[^]: the above are all the same as the basic regular expression
Number of matches:
*:
?: above with the basic regular expression
+: match its first character at least 1 times, with \ (1,\) .
{m,n}: the match period before the character at least m times, the more N times.
Anchor Position:
The same basic regular expression.
Group:
(): don't need \ .
| : Or, a|b:a or b,c| Cat:c or Cat.
Regular expression meta-character collation