Emacs Mode



Classes

.
Match anything except the newline character.
\[
Start a character class.
\[^
Start a negated character class.
\]
Close a character class.
-
Create a character range like a-h.
a-z
Match any lowercase letter.
A-Z
Match any uppercase letter.
0-9
Match any digit.

Grouping

\\(
Start a group or back reference.
\\)
End a group or back reference.
\\|
Alternate (or) - a|b|c matches either a or b or c.
\\N
Substitute Nth match within \\( and \\).
\\<
Match the BEGINNING of a word.
\\>
Match the END of a word.

Counting

.
Match anything except the newline character.
?
One match allowed, but its optional.
*
Zero or more matches allowed.
+
One match required, additional are optional.

Anchor

^
Insert start of line position marker.
$
Insert end of line position marker.
^$
Match a blank line.
^.*$
Match an entire line.

Shorthand

\\b
Match a word boundary.
\\B
Match a word boundary.
\\w
Match characters in syntax class
\\W
Do NOT match characters in syntax class
\\s
Match whitespace - \[ \f\t\n\v\r\]
\\S
Do NOT match whitespace - \[^ \f\t\n\v\r\]
\\
Escape a special character.
\\"
Insert a quote.

Ascii

\\a
Match ALERT within a regexp.
\\b
Match BACKSPACE within a regexp.
\\e
Match ESCAPE within a regexp.
\\f
Match FORM-FEED within a regexp.
\\n
Match LINE-FEED within a regexp.
\\r
Match CARRIAGE RETURN within a regexp.
\\t
Match TAB within a regexp.
\\v
Match VERTICAL TAB within a regexp.


Index