Build extraction rules
Test named-looking pieces such as order codes, tags, dates, or headings before putting a pattern in application code.
Test JavaScript regular expressions in your browser. View matches, capture groups, flags, indexes, and syntax errors against sample text.
See matches, groups, and common errors. Your result updates in the current tab as you work.
See matches, groups, and common errors. Nothing you enter here is uploaded or stored.
1. team@example.com [index 8]
2. support@sovrancode.dev [index 28]
--- Test details ---
Pattern: /\b[a-z]+@[a-z]+\.[a-z]{2,}\b/gi
Matches: 2Regular expressions are compact programs for matching text. They can validate a small pattern, extract structured pieces, or become unreadable when they attempt to parse an entire language. This tester runs a JavaScript regular expression against your sample text and reports each match, position, and capture group.
Test named-looking pieces such as order codes, tags, dates, or headings before putting a pattern in application code.
See exactly which parenthesized groups are returned for every match.
Compare case-insensitive, global, multiline, or Unicode behavior against a real sample.
These examples are specific to Regex tester. Replace their values with your own, then use the result as a clue—not as a substitute for application validation.
Release notes contain project references such as SC-204 and API-19.
pattern: ([A-Z]{2,8})-(\d+)
text: Fixes SC-204; follows API-19.Match 1: SC-204 → group 1: SC, group 2: 204 Match 2: API-19 → group 1: API, group 2: 19
The outer parentheses make each piece available to application code, while the global flag finds every occurrence.
You only want the word cat, not catalog or educate.
pattern: \bcat\b text: cat catalog educate
Match: cat at index 0
Word boundaries are useful for word-like text, but test punctuation and non-Latin text because boundary behavior is engine-specific.
Use the result to make a decision in your code or content, not merely to produce another value to copy.
Do not include leading and trailing slash delimiters; enter flags in the separate field.
Include expected matches, near misses, and an edge case so a pattern is not accidentally too broad.
A match that looks right once can still capture the wrong text or skip a later occurrence.
An email-shaped string is not proof an inbox exists, and a date-shaped string is not proof it is a valid calendar date. Pair pattern matching with domain validation where correctness matters.
The m flag changes what ^ and $ mean across lines. The s flag allows dot to cross line breaks. The u flag changes Unicode interpretation. Make flags part of the test case rather than an afterthought.
/^todo$/m.test("done\ntodo\nnext") // true
/^todo$/.test("done\ntodo\nnext") // falseEach tool is deliberately narrow. These are the mistakes most likely to appear when its output is copied into a real product without checking the surrounding constraint.
Why it matters: JavaScript advances lastIndex for global regexes, which can make alternating calls appear to fail.
Better approach: Use a non-global expression for a yes/no test or reset lastIndex before each call.
Why it matters: It becomes fragile, hard to review, and can have poor performance.
Better approach: Use a parser for structured formats and keep regexes focused on bounded tokens.
These tools help with bounded client-side work. Production decisions still need the validation, review, and authorization appropriate to your application.
It uses the JavaScript RegExp engine available in your browser. Syntax and flags can differ from PCRE, Python, Ruby, or database regex engines.
Check escaping, case, whitespace, flags, and whether \b boundaries fit punctuation in the sample. Start with a smaller literal pattern, then add constraints.
No. Use an HTML parser or JSON parser for nested structured formats. Regex is best for bounded text patterns.