Emacs: Regular Expression
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.
Regex Commands
The most commonly used commands that use regex are:
- Alt+x
list-matching-lines
〔see Emacs: List Matching Lines〕 - Alt+x
query-replace-regexp
〔see Emacs: Find Replace in Current File〕
Emacs, commands using regex
Emacs Regular Expression
Emacs Find Replace
- Emacs: Search Text in Current File
- Emacs: Search Current Word 🚀
- Emacs Init: isearch Whitespace Regex
- Emacs Init: isearch by Arrow Keys
- Emacs: Highlight Word, Line
- Emacs: List Matching Lines
- Emacs: Search Text in Directory
- Emacs: Find Replace in Current File
- Emacs: Interactive Find Replace Text in Directory
- Emacs: Xah Find Replace (xah-find.el) 📦
- Emacs: Regular Expression