Kleene's regular sets
The logician Stephen Kleene spent the summer of 1951 at the RAND Corporation, where he found a key characterisation of finite automata: the "regular sets" behind regular expressions.
Run it. Get results.
No tool matches that. Try another word.
Mathematics
Mathematics
Utilities
Utilities
Image
Image
Language
Language
Networking
Networking
Finance
Finance
Cybersecurity
Cybersecurity
Text
Text
Date
Date
Measurement
Measurement
Audio
Audio
Health
Health
Nutrition
Nutrition
Time
Time
Weather
Weather
Document Processing
Document Processing
Productivity
Productivity
Career
Career
Business
Business
Video
Video
Education
Education
Statistics
Statistics
Chemistry
Chemistry
Physics
Physics
Construction
Construction
Electrical Engineering
Electrical Engineering
Programming
Programming
Graphic Design
Graphic Design
Computer Science
Computer Science
Database
Database
Music
Music
Digital Electronics
Digital Electronics
Electronics Engineering
Electronics Engineering
A free regex tester: type a regular expression and some text, and see every match highlighted as you type, with each match's position and groups (named groups too), a replace preview ($1, $<name>) and the pattern explained piece by piece in plain words. Start from ready patterns for emails, URLs, Philippine mobile numbers, dates and IP addresses. It uses JavaScript regular expressions, in your browser.
JavaScript (ECMAScript). The basics (classes, groups, quantifiers, anchors) work the same in Python, PHP (PCRE), Java and .NET; lookbehind and named groups are written slightly differently in some.
Turn on the g (global) flag to find every match.
Put a backslash before it: \. matches a dot, \( a bracket. Without it, . means "any character".
The pattern backtracked too much (for example (a+)+ on a long text). It is stopped so the page doesn't freeze; make the repeats less nested or more specific.
$1, $2… insert numbered groups, $<name> a named group and $& the whole match.
No: the pattern runs in your browser only.
The logician Stephen Kleene spent the summer of 1951 at the RAND Corporation, where he found a key characterisation of finite automata: the "regular sets" behind regular expressions.
Ken Thompson's QED editor was the first to let users search and substitute with regular expressions; before that, editors could search only for a literal string.
Source: Dennis Ritchie (Bell Labs)
The "standard Unix editor" ed, first written by Ken Thompson, cut regular expressions down to the * operator: no alternation and no parentheses.
Source: Dennis Ritchie (Bell Labs)
The PCRE library, first released in 1997, matches with the same syntax and meaning as Perl 5, and is used by Apache, PHP, KDE, Postfix and Nmap.
Source: PCRE
ECMAScript 2018 added four regular expression features to JavaScript: the dotAll flag, named capture groups, Unicode property escapes and look-behind assertions.
Source: TC39 (ECMAScript 2018)
On 2 July 2019 a poorly written regular expression backtracked so much that it used up Cloudflare's CPUs, taking its service down for 27 minutes.
Source: Cloudflare
Match a real . * + ? by putting \ before it.
^ and $ make the pattern match the whole text.
Turn on g to find every match, not just the first.
Add ? after * or + to take as little as possible.
( ) keeps a part: use it as $1 in replacements.
(?<year>\d{4}) is easier to read than $1.
Patterns like (a+)+ can take forever on long text.
Test text that should match and text that shouldn't.
Advertisements
Advertisements