Regex to English

Paste a regular expression to get a plain-English explanation of every component. 100% client-side.

Flags:
Explanation
Type or paste a regex above to see its explanation.
Enter a regex pattern above.

How to Use the Regex Explainer

  1. Type or paste your regex in the input field — without surrounding slashes (e.g., ^hello\s+world$ not /^hello\s+world$/).
  2. Set flags if needed — g (global), i (case-insensitive), m (multiline), s (dotAll).
  3. Choose a view mode — Detailed for full component-by-component breakdown, Summary for a one-paragraph description, Tree View for a nested structure.
  4. Copy or download the explanation for documentation or sharing.

Regex Syntax Quick Reference

Regular expressions use a compact syntax that can look intimidating at first. This explainer breaks down each token into plain language. Here is a reference of the most common constructs.

Anchors

Anchors match positions, not characters. ^ matches the start of the string (or start of each line in multiline mode). $ matches the end of the string (or end of each line). \b matches a word boundary — the position between a word character and a non-word character. \B matches any position that is not a word boundary.

Character Classes

A character class [abc] matches any single character listed inside the brackets. Ranges like [a-z] match any lowercase letter. A negated class [^abc] matches any character NOT in the list. Shorthand classes provide compact notation: \d matches digits (equivalent to [0-9]), \w matches word characters ([a-zA-Z0-9_]), \s matches whitespace (spaces, tabs, newlines). Their uppercase versions (\D, \W, \S) match the inverse.

Quantifiers

Quantifiers specify how many times the preceding element must match. * means zero or more, + means one or more, ? means zero or one (optional). Exact counts use curly braces: {3} means exactly 3 times, {2,5} means between 2 and 5 times, {2,} means 2 or more times. All of these are greedy by default — adding ? after (*?, +?, ??) makes them lazy, matching as few characters as possible.

Groups and Alternation

Parentheses (abc) create a capture group that records the matched text for later use. (?:abc) creates a non-capturing group, useful for grouping without capturing. Named groups (?<name>abc) let you reference the capture by name. Alternation cat|dog matches either "cat" or "dog". Lookaheads (?=...) and lookbehinds (?<=...) match positions based on context without consuming characters.

Common Regex Patterns Explained

Email validation: ^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$ — starts with one or more alphanumeric/special characters, followed by @, a domain, a dot, and a TLD of 2+ letters. URL matching: https?://[^\s]+ — http or https, followed by ://, followed by non-whitespace characters. IPv4: (\d{1,3}\.){3}\d{1,3} — three groups of 1-3 digits followed by dots, then a final group of digits.

For hands-on testing of your regex patterns, use our Regex Tester. To escape special characters in strings for use in regex, try the String Escape tool.

Frequently Asked Questions

A regular expression (regex) is a sequence of characters that defines a search pattern. Regex patterns are used to find, match, extract, or replace text. They are supported in virtually every programming language including JavaScript, Python, Java, Go, PHP, and Rust.
The ^ (caret) symbol means "start of string" at the beginning of a pattern. Inside a character class like [^abc], ^ means "NOT" — so [^abc] matches any character that is NOT a, b, or c. With the multiline flag (m), ^ matches the start of each line.
A capture group (plain parentheses) captures the matched text as a numbered backreference. A non-capturing group (?:...) groups elements for quantifiers or alternation without capturing. Non-capturing groups are preferred when you don't need the captured value.
Greedy quantifiers (*, +, ?) match as many characters as possible. Lazy quantifiers (*?, +?, ??) match as few characters as possible. On '<b>bold</b>', greedy <.*> matches the entire string, while lazy <.*?> matches just '<b>'.
No. The regex explainer runs entirely in your browser. Your pattern never leaves your machine. There is no server, no logging, and no data collection.