Codrix — Regular Expression Syntax Basics | codrix.org
A dated table of milestones: Kleene's 1950s regular language, Thompson's 1968 QED editor, Spencer's 1986 library and Perl, Hazel's 1997 PCRE, and the POSIX standards.
The concept of regular expressions began in the 1950s, when the American mathematician Stephen Cole Kleene formalized the concept of a regular language. That formalization is the theoretical root of every token you type today, and it is why the notation is called regular in the first place.
Regular expressions entered popular use from 1968 in two uses: pattern matching in a text editor and lexical analysis in a compiler. Ken Thompson built Kleene's notation into the editor QED as a means to match patterns in text files, implementing matching by just-in-time compilation for speed. The two uses set the shape that modern engines still follow.
On narrow screens, swipe or scroll the plate sideways.
More complicated regexes arose in Perl, which originally derived from a regex library written by Henry Spencer in 1986. Different syntaxes for writing regular expressions have existed since the 1980s, among them the IEEE POSIX basic and extended standards, so a parallel standard family exists alongside the Perl-style one.
Starting in 1997, Philip Hazel developed PCRE (Perl Compatible Regular Expressions), which attempts to closely mimic Perl's regex functionality. PCRE is the reason a pattern written for a Perl-style engine often runs unchanged in tools that are not written in Perl.
When a pattern works in one tool and fails in another, the difference is usually a dialect rather than a mistake in your logic. Confirm which dialect the target tool uses before you write, and re-test the finished pattern there.
Further reading