Emacs: Regular Expression

By Xah Lee. Date: . Last updated: .

What is Regular Expression

Regular Expression (aka regex) is a character sequence that represent a pattern for matching text. For example, you can use it to find all email addresses in a file by matching the email address pattern. Regex is used by many functions to check if a string contains certain pattern, or extract it, or replace it with other string.

(video tutorial: xah talk show 2022-08-04 emacs regular expression)

Regex Commands

The most commonly used commands that use regex are:

Emacs, Regular Expression in Interactive Commands

Emacs Regular Expression

Emacs Find Replace