Regex Explainer
Convert regex patterns to plain English, in your browser.
What it's for
Regular expression explainer
All flavors
Compatible with JavaScript, Python, PCRE, Java, Go, and Ruby patterns.
100% private
Pattern analysis happens in your browser. Your data never leaves your device.
Clear explanation
Each token in the pattern explained in plain language, with match examples.
Instant
Real-time explanation as you type. No signup, no waiting.
How it works
Three steps, no hassle
Paste your regular expression
Type or paste the regex pattern you want to understand, with or without delimiters.
Instant explanation
The tool analyzes the pattern and describes in plain English what each part does: groups, quantifiers, character classes, and more.
Test with real text
Enter sample text to see which parts match the pattern in real time.
FAQ
Got questions?
A regular expression is a pattern language for searching and manipulating text. It lets you precisely describe a pattern: for example, 'a phone number', 'an email address', or 'a URL'. The regex engine scans text looking for strings that match that pattern. They are supported by virtually all modern programming languages.
Email: ^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$. URL: https?:\/\/(www\.)?[-a-zA-Z0-9@:%._+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}. International phone: \+?[1-9]\d{1,14}. Digits only: ^\d+$. US ZIP code: ^\d{5}(-\d{4})?$.
Regex are extremely terse: every character has a potential special meaning. The dot (.) matches any character. The asterisk (*) means 'zero or more times'. Brackets ([]) define character classes. This information density means a 20-character expression can represent very complex rules, but also makes it hard to understand at first glance without practice.
PCRE (Perl Compatible Regular Expressions) is the de facto standard for PHP, Apache, nginx. JavaScript has its own engine with differences: older versions don't support variable-length lookbehind, and has the /u flag for Unicode. Python uses the re module with syntax similar to PCRE but with some differences (e.g., \A and \Z for string start/end). Go uses RE2, which doesn't support backreferences for performance reasons. Java uses java.util.regex with extended POSIX syntax.
Characters with special meaning in regex are: . * + ? ^ $ { } [ ] | ( ) \. To use them literally, escape with backslash: \. for a literal dot, \* for a literal asterisk. In JavaScript inside a string, you need double escaping: '\\.' because the string already consumes one backslash. Many languages offer functions like re.escape() in Python or preg_quote() in PHP.
History of regular expressions (Ken Thompson 1968 ed editor), formal language theory, regex in modern programming
Regular expressions originate in the formal language theory developed by mathematician Stephen Kleene in the 1950s, who defined 'regular sets' and the algebraic notation to describe them. Ken Thompson was the first to implement regex in software when he integrated them into the Unix text editor ed in 1968 (and later in grep, whose name comes from 'global regular expression print'). His implementation used compilation to machine code for efficient searching, a technique that laid the groundwork for modern regex engines.
The mass popularization of regex came with Perl in the 1980s and 1990s. Larry Wall integrated regex natively into the language syntax, and PCRE (Perl Compatible Regular Expressions) became the de facto standard. POSIX formalized two levels: BRE (Basic Regular Expressions) and ERE (Extended Regular Expressions) in the 1992 standard. Today, virtually all programming languages include regex support: Python (re module), JavaScript (RegExp), Java (java.util.regex), Go (regexp/RE2), Ruby, PHP (preg_*), .NET and many more.
Regex are a double-edged tool: extremely powerful but also a source of vulnerabilities. ReDoS (Regular Expression Denial of Service) is an attack type where a poorly written regex pattern can cause exponential execution time with certain malicious inputs. Google's RE2 engine (used in Go) was specifically designed to guarantee linear execution time, eliminating the possibility of ReDoS at the cost of not supporting backreferences. OWASP includes ReDoS in its list of security risks in web applications.