regular expression

Text matching formula

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

The syntax uses special characters to represent patterns: a dot matches any character, an asterisk means "zero or more," brackets define character sets.

Often shortened to regex or regexp.

The regex matched all email addresses in the document.

operations

pattern matching

Detecting consistent structures

  • matchGame between opponents
  • findLocate through effort
  • replacePut something else there

search · parse · validate · extract · capture · split · substitute · test · filter · locate

syntax

pattern

Recurring arrangement or template

escape sequence · anchor · alternation · greedy · lazy · dot · caret · dollar sign · bracket · parenthesis

components

lookahead

Advance examination technique

atom · token · substring

programming

Perl

Text-processing scripting language

Ruby · PHP · library · module · compile · NFA

Categories
Opposites
pattern matching approach

regular expressionkeyword search

Finding results using terms

fuzzy search · full-text search

search precision and flexibility

regular expressionexact match

Perfect one-to-one correspondence

formal language complexity

regular expressionwildcard

Unpredictable factor in play

plain English

Family

regular, express, expression, regularly, regulate, irregular, regulation, regulated, irregularity

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