regex

Technology & Computing abbreviation · Programming

regex
Stands forRegular expression
CategoriesTechnology & Computing

regex stands for Regular expression, a programming abbreviation.

A pattern language for matching text, used to search, validate and replace strings, such as ^\d{5}$ for a five-digit ZIP code. Almost every programming language, text editor and command-line tool supports regexes.

Example: The regex for order numbers is ^ORD-\d{6}$, so lowercase prefixes fail validation.

Usage notes

Mathematician Stephen Kleene described regular languages in the 1950s, and Ken Thompson built them into the QED editor and later grep. Also written regexp; the plural is regexes. Flavors such as POSIX, PCRE and JavaScript differ in features like lookbehind. Badly written patterns can backtrack catastrophically; one caused Cloudflare's global outage in July 2019. A well-known joke says that solving a problem with a regex leaves you with two problems.

More programming abbreviations

  • PRNG – Pseudorandom number generator
  • PTAL – Please take a look
  • pwd – Print working directory
  • PyPI – Python Package Index
  • QA – Quality assurance (software)
  • RAII – Resource acquisition is initialization
  • REPL – Read-eval-print loop
  • REST – Representational state transfer
  • RNG – Random number generator
  • RoR – Ruby on Rails
  • RPC – Remote procedure call
  • SAFe – Scaled Agile Framework

See all 154 programming abbreviations →