Skip to content
ForgePlug — Logo
Developer100% Browser-Based

Regex Tester & Builder

The most beginner-friendly and developer-friendly Regex Playground on the internet. Test regular expressions with live highlighting, multi-color capture groups, replace and split modes. Learn regex with the exclusive Live Explainer that explains every token instantly. Debug failing patterns with intelligent failure analysis. Build regex without writing code using the visual builder. Browse ready-made patterns from an extensive library. All processing happens entirely in your browser — nothing leaves your device.

Regex Pattern

Flags:
gGlobal — find all matches, not just the first

Test Text

Live Highlighting

0 matches
Enter a regex and test text to see highlighting.

Live Explainer

Type a regex pattern to see explanations

Quick Examples

Load pre-built examples to see how regex works.

Email Extraction

[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}

URL Finder

https?://[\w.-]+(:\d+)?(/[\w./%-]*)?

Phone Numbers

\+?\d[\d -]{7,}\d

Date Extraction

\b\d{4}-(?:0[1-9]|1[0-2])-(?:0[1-9]|[12]\d|3[01])\b

Hex Colors

#[0-9a-fA-F]{3}(?:[0-9a-fA-F]{3})?\b

HTML Tags

<[^>]*>

Frequently Asked Questions

What is a regular expression (regex)?
A regular expression (regex or regexp) is a sequence of characters that defines a search pattern. It's used for pattern matching, text validation, search and replace, and text extraction. Regex is supported in almost every programming language and text editor.
Is my data sent to a server?
Absolutely not. Everything happens entirely in your browser. The regex matching, token explanation, debugging, and all other features work using JavaScript's built-in RegExp engine. Your regex patterns and test data never leave your device — no network requests, no uploads, no server processing.
How does the Live Explainer work?
The Live Explainer tokenizes your regex pattern character by character and provides a human-readable explanation for each token. For example, '^' is explained as 'Start of string', '\d' as 'Any digit (0-9)', and '{3}' as 'Exactly 3 of the preceding element'. The explanation updates instantly as you type.
How do I use capture groups?
Capture groups are created using parentheses ( ) in your regex pattern. Each group captures a portion of the match. You can reference captured groups with backreferences like \1, \2, etc. Non-capturing groups (?: ) group without capturing. Named groups (?<name>...) let you give groups descriptive names. The Capture Groups panel shows all captured values for each match.
What is catastrophic backtracking?
Catastrophic backtracking occurs when a regex pattern contains nested or adjacent quantifiers (like (a+)+ or .*.*), causing the regex engine to try an exponential number of combinations. This can freeze your browser or crash the application. ForgePlug's Performance Analyzer detects these patterns and warns you.
What's the difference between greedy and lazy matching?
Greedy quantifiers (like *, +) match as much as possible. Lazy quantifiers (like *?, +?) match as little as possible. For example, given the text '&lt;div&gt;&lt;span&gt;&lt;/div&gt;', the pattern '&lt;.*&gt;' matches the entire string (greedy), while '&lt;.*?&gt;' matches '&lt;div&gt;' only (lazy).
Can I save my regex patterns?
Yes! ForgePlug automatically saves your current pattern, flags, test text, and mode to localStorage. When you return, your work is restored. You can also share regex patterns via a URL by clicking the Share button, which encodes your pattern in the URL parameters.
What are lookaheads and lookbehinds?
Lookaheads and lookbehinds are zero-width assertions that check for patterns without including them in the match. Positive lookahead (?=...) matches if followed by the pattern. Negative lookahead (?!...) matches if NOT followed by the pattern. Lookbehinds work similarly but check what precedes the match.
What regex engine does ForgePlug use?
ForgePlug uses the JavaScript RegExp engine, which is built into every modern browser. This means the regex patterns you create here are compatible with JavaScript, TypeScript, and many other environments. Note that JavaScript regex lacks some features like possessive quantifiers and recursive patterns found in PCRE.
What does the 's' (dotAll) flag do?
The 's' (dotAll) flag changes the behavior of the dot (.) metacharacter so it also matches newline characters. Without the 's' flag, '.' matches any character except newlines. With the 's' flag, '.' matches every character including \n. This is especially useful when parsing multi-line text.
4.8 · Trusted by Developers

Frequently Asked Questions

Everything you need to know about testing regular expressions

What is a regular expression (regex)?
A regular expression (regex or regexp) is a sequence of characters that defines a search pattern. It's used for pattern matching, text validation, search and replace, and text extraction. Regex is supported in almost every programming language and text editor.
Is my data sent to a server?
Absolutely not. Everything happens entirely in your browser. The regex matching, token explanation, debugging, and all other features work using JavaScript's built-in RegExp engine. Your regex patterns and test data never leave your device — no network requests, no uploads, no server processing.
How does the Live Explainer work?
The Live Explainer tokenizes your regex pattern character by character and provides a human-readable explanation for each token. For example, '^' is explained as 'Start of string', '\d' as 'Any digit (0-9)', and '{3}' as 'Exactly 3 of the preceding element'. The explanation updates instantly as you type.
How do I use capture groups?
Capture groups are created using parentheses ( ) in your regex pattern. Each group captures a portion of the match. You can reference captured groups with backreferences like \1, \2, etc. Non-capturing groups (?: ) group without capturing. Named groups (?<name>...) let you give groups descriptive names. The Capture Groups panel shows all captured values for each match.
What is catastrophic backtracking?
Catastrophic backtracking occurs when a regex pattern contains nested or adjacent quantifiers (like (a+)+ or .*.*), causing the regex engine to try an exponential number of combinations. This can freeze your browser or crash the application. ForgePlug's Performance Analyzer detects these patterns and warns you.
What's the difference between greedy and lazy matching?
Greedy quantifiers (like *, +) match as much as possible. Lazy quantifiers (like *?, +?) match as little as possible. For example, given the text '&lt;div&gt;&lt;span&gt;&lt;/div&gt;', the pattern '&lt;.*&gt;' matches the entire string (greedy), while '&lt;.*?&gt;' matches '&lt;div&gt;' only (lazy).
Can I save my regex patterns?
Yes! ForgePlug automatically saves your current pattern, flags, test text, and mode to localStorage. When you return, your work is restored. You can also share regex patterns via a URL by clicking the Share button, which encodes your pattern in the URL parameters.
What are lookaheads and lookbehinds?
Lookaheads and lookbehinds are zero-width assertions that check for patterns without including them in the match. Positive lookahead (?=...) matches if followed by the pattern. Negative lookahead (?!...) matches if NOT followed by the pattern. Lookbehinds work similarly but check what precedes the match.
What regex engine does ForgePlug use?
ForgePlug uses the JavaScript RegExp engine, which is built into every modern browser. This means the regex patterns you create here are compatible with JavaScript, TypeScript, and many other environments. Note that JavaScript regex lacks some features like possessive quantifiers and recursive patterns found in PCRE.
What does the 's' (dotAll) flag do?
The 's' (dotAll) flag changes the behavior of the dot (.) metacharacter so it also matches newline characters. Without the 's' flag, '.' matches any character except newlines. With the 's' flag, '.' matches every character including \n. This is especially useful when parsing multi-line text.

Share this tool

Share
Runs in your browser100% privateNo data uploaded