Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?

Emacs has an ususual way of escaping special characters in regular expressions, which I keep forgetting, so here's a summary

Literal Special Emacs bare Emacs escaped
* \*
* 0 or more *
+ \+
+ 1 or more +
? \?
? 0 or 1 ?
( ) ( )
() grouping \( \)
[ ] \[ \]
[ ] char class [ ]
{ } { }
{ } repetition \{ \}
| |
| alternative \|
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.