regex

String search pattern

Regex is short for regular expression—a sequence of characters that defines a search pattern, used in programming and text processing to find, match, or replace strings.

A regex can match something simple like all email addresses in a document or something complex like valid phone number formats: The regex caught malformed URLs.

Learning regex syntax is notoriously steep but powerful once mastered.

matching

match

Game between opponents

substitute · extract · capture · group · subpattern · lookahead · assertion · greedy · lazy · possessive

engines

grep

Text pattern search utility

  • PerlText-processing scripting language
  • JavaScriptWeb programming language
  • PythonLarge nonvenomous squeezer

NFA · backtracking · compilation · optimization · matcher · parser · tokenizer · flavor · implementation

syntax

pattern

Recurring arrangement or template

escape · literal · alternation · anchor · boundary · flags · modifier · delimiter · bracket · dot

validation

input

Data received for processing

verify · constraint · format · email · URL · whitelist · blacklist · acceptance · rejection · security

Categories
Opposites
pattern matching sophistication

regexexact match

Perfect one-to-one correspondence

simple search · find and replace · keyword search

Phrases
Family

regular, regular expression

Familiarity
Top 1,000,000
Profile
Used worldwide · Timeless · Abstract · Rated G