Changes to Regular expression
TechWritereditor · 5 Dec 2026, 05:27 · “New page”
+ added − removed (first version)
Title
Removed:
Added: Regular expression
Short description
Removed:
Added: Pattern language for matching text in strings
Type
Removed:
Added: technology
Summary
Removed:
Added: A regular expression is a compact pattern that describes a set of character strings, used to search, match and replace text. It is supported by text editors, command-line tools and most programming languages.
Fact box
Removed:
Added: Type: Text-matching pattern notation
Added: Theoretical basis: Finite automata
Added: Early software use: QED text editor (1960s)
Added: Key developer: Ken Thompson
Added: Common tools: ed, grep, programming languages
Article
Added: **Regular expressions** are patterns used to match combinations of characters in strings of text.[^1] They let a user describe not just a fixed word but a whole family of strings – for example, "any three digits" – and then find, test or replace every match.[^1]
Added: ## History
Added: Regular expressions are closely linked to the theory of finite automata. In 1951 the mathematician Stephen Kleene wrote a RAND Corporation research memorandum, *Representation of Events in Nerve Nets and Finite Automata*, examining the kinds of events a finite automaton can respond to.[^2]
Added:
Added: [[Ken Thompson]] brought regular expressions into practical computing. According to [[Dennis Ritchie]], Thompson's version of the QED text editor, written for the CTSS time-sharing system, differed from earlier versions mainly by introducing regular expressions for specifying the strings to search for; before this, editors could search only for literal text.[^3] Thompson described his method in the paper "Regular expression search algorithm" in *Communications of the ACM* in 1968.[^3] His technique compiled each expression on the fly into machine code that simulated a nondeterministic finite automaton.[^3] The paper explains a compiler that takes a regular expression as its source language and produces an IBM 7094 program that signals each time a piece of text matches.[^4]
Added:
Added: When Thompson wrote the ed editor for [[Unix]], he radically simplified the notation, and later Unix tools such as grep continued Bell Labs' work on fast regular-expression matching.[^3]
Added:
Added: ## How it works
Added: A regular expression mixes ordinary characters with special symbols. In the pattern `ab*c`, the `*` means "zero or more of the preceding item", so it matches "ac", "abc", "abbbbc" and so on.[^1] The sequence `\d{3}` means three numeric characters.[^1]
Added:
Added: In [[JavaScript]], a regular expression can be written between slashes, as in `/ab+c/`, or built with the `RegExp` constructor, which is useful when part of the pattern comes from user input.[^1] Methods such as `test()`, `match()`, `replace()` and `split()` let programs check for a match, collect matches, substitute text or break a string into pieces.[^1]
Added:
Added: ## See also
Added: - [[Ken Thompson]]
Added: - [[Unix]]
Added: - [[Perl]]
Added: - [[JavaScript]]
Sources
Removed:
Added: Regular expressions – JavaScript guide | https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_expressions | MDN Web Docs (Mozilla)
Added: Representation of Events in Nerve Nets and Finite Automata | https://www.rand.org/pubs/research_memoranda/RM704.html | RAND Corporation | 1951-12-15
Added: An incomplete history of the QED Text Editor | https://www.nokia.com/bell-labs/about/dennis-m-ritchie/qed.html | Nokia Bell Labs
Added: Programming Techniques: Regular expression search algorithm | https://cacm.acm.org/research/programming-techniques-regular-expression-search-algorithm | Communications of the ACM
Categories
Removed:
Added: Software
Added: Programming languages
Other names
Removed:
Added: Regex
Added: Regexp
Added: Rational expression