Next: How do I perform a replace operation across more than one file?, Previous: How do I tell Emacs to iconify itself?, Up: Common requests [Contents][Index]
See Regexp Backslash in The GNU Emacs Manual.
The or
operator is ‘\|’, not ‘|’, and the grouping operators
are ‘\(’ and ‘\)’. Also, the string syntax for a backslash is
‘\\’. To specify a regular expression like ‘xxx\(foo\|bar\)’
in a Lisp string, use ‘xxx\\(foo\\|bar\\)’.
Note the doubled backslashes!