Emacs Regex vs Regex in Python, JavaScript, Java Etc
Emacs regular expression is different from the regular expression in JavaScript, Python, Ruby, Perl etc.
Here are practical major differences.
JavaScript, Python, Perl, Java Etc | emacs lisp (may not be exactly equivalent) | |
Capture | "(capture)" | "\\(capture\\)" |
digit | "\d" | "[0-9]" or "[[:digit:]]" † |
word | "\w" | "[_A-Za-z0-9]" or "[[:word:]]" † |
whitespace | "\s" | "[ \n\t]" or "[[:space:]]" † |
† Emacs Regular Expression Named Character Class and Syntax Table
Emacs Regular Expression
- Regular Expression
- Regex Syntax
- About Quoting Regex
- Case Sensitivity
- How to Insert a Tab or Newline
- Wildcards vs Regex
- Emacs Regex vs Python, JavaScript, Java