Elisp: Regex Functions
Search Text Functions for Buffer
re-search-forward
re-search-backward
〔see Elisp: Search Text Functions〕
Replace Match
replace-match
〔see Elisp: Find Replace Text in Buffer〕
Get Captured Group
match-data
match-string
match-beginning
match-end
Regex Function for Matching in a String
string-match
replace-regexp-in-string
〔see Elisp: String Functions〕
regexp-quote
regexp-quote
-
quote regex so it becomes plain text for regex functions.
(regexp-quote ".png") ;; "\\.png" (regexp-quote "[template]") ;; "\\[template]" (regexp-quote "(* comment. applescript ocaml pascal wolframlang *)") ;; "(\\* comment\\. applescript ocaml pascal wolframlang \\*)"
Emacs Lisp, Regex in Lisp Code
- Elisp: Regular Expression
- Elisp: Regex Functions
- Emacs: Regular Expression Syntax
- Elisp: Regex Backslash in Lisp Code
- Elisp: Case Sensitivity (case-fold-search)
- Elisp: Find Replace Text in Buffer
- Elisp: Match Data (Regex Result)
- Elisp: Unicode Escape Sequence
- Elisp: Convert Regex to Lisp Regex String
- Elisp: How to Test Regex
- Elisp: Regex in Readable Syntax, Package Rx
- Elisp: Regex Named Character Class and Syntax Table
- Emacs Regex vs Regex in Python, JavaScript, Java