ToolStop
Definition

What is Regex (Regular Expression)?

A regex is a mini-language for describing text patterns — used to find, validate, or replace substrings in a larger body of text.

Also called: regular expression · regexp · pattern matching

Regex uses metacharacters (., *, +, ?, [], (), |, ^, $) to describe patterns like 'any digit', 'one or more letters', or 'an email-looking string'. Every mainstream programming language ships a regex engine.

Typical jobs: validating email addresses and phone numbers, extracting URLs from a blob of text, renaming a batch of files, or building search-and-replace rules in an editor.

Regex is fast to write and hard to read. Test patterns in an interactive tester and add comments; a small mistake in a greedy quantifier can match far more than you intended.

Try a tool that uses Regex (Regular Expression)

Related definitions