Elisp: Regex Functions
Search Text Functions for Buffer
re-search-forwardre-search-backward
[see Elisp: Search Text Functions]
Replace Match
replace-match
[see Elisp: Find Replace Text in Buffer]
Get Captured Group
match-datamatch-stringmatch-beginningmatch-end
Regex Function for Matching in a String
string-matchreplace-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 \\*)"