Emacs Lisp: Regular Expression

By Xah Lee. Date: . Last updated: .

Regex Functions

Regex Syntax

Quoting Regex in Emacs Lisp Code vs Command Prompt

Find Replace Text

How to Test Regex in Emacs Lisp Code

Convert Regex to Lisp Regex String

Regex in Lisp Syntax: rx Package

There is a elisp package rx that uses lisp style syntax to represent regex syntax.

(require 'rx)

;; this
(rx (one-or-more blank) line-end)

;; returns this
;; "[[:blank:]]+$"

I do not recommend it. Because it's a middleman with associated complexity. Just learn and use raw regex directly.

Emacs Regular Expression

Regex in Emacs Lisp