Skip to content

Instantly share code, notes, and snippets.

@mvidner
Last active April 8, 2019 09:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mvidner/4f60c5f448b0f1fb07754e2f2458ca5f to your computer and use it in GitHub Desktop.
Save mvidner/4f60c5f448b0f1fb07754e2f2458ca5f to your computer and use it in GitHub Desktop.

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