35.9 Emacs versus POSIX Regular Expressions

Regular expression syntax varies significantly among computer programs. When writing Elisp code that generates regular expressions for use by other programs, it is helpful to know how syntax variants differ. To give a feel for the variation, this section discusses how Emacs regular expressions differ from two syntax variants standarded by POSIX: basic regular expressions (BREs) and extended regular expressions (EREs). Plain grep uses BREs, and ‘grep -E’ uses EREs.

Emacs regular expressions have a syntax closer to EREs than to BREs, with some extensions. Here is a summary of how POSIX BREs and EREs differ from Emacs regular expressions.


emacs

Emacs

org-mode

Orgmode

Donations

打赏

Copyright

© 2025 Jasper Hsu

Creative Commons

Creative Commons

Attribute

Attribute

Noncommercial

Noncommercial

Share Alike

Share Alike