Free tool
Regex generator and tester
Paste a regular expression and sample text, toggle flags, and see matches with capturing groups—evaluated with JavaScript in your browser. Use the Google Sheets & Excel section for REGEXMATCH, REGEXEXTRACT, and REGEXREPLACE patterns. This is not a full PCRE debugger like regex101; read the FAQ for Google Sheets RE2 limits.
When to use this tool
Fast checks before you paste the same logic into Google Sheets or Excel—transparent matching, not a security audit.
- See whether a SKU, invoice ID, or date pattern matches messy pasted text.
- Preview capturing groups before you move extraction into REGEXEXTRACT.
- Toggle case and multiline flags the same way you think about JavaScript regex in apps.
- Copy a REGEXMATCH example into a cell after you settle on a pattern here.
We compile your pattern with JavaScript RegExp using the flags you pick, then walk the haystack to collect matches. Global mode lists every match until caps stop the run.
- JavaScript engine in the browser
Results here follow ECMAScript regex rules. Lookbehind and some other features depend on your browser version—always re-check in Sheets if that engine differs.
- Google Sheets uses RE2
REGEXMATCH and related functions use RE2, which omits some PCRE features (for example backreferences and most lookaround). If Sheets disagrees with this page, trust Sheets for workbook behavior.
- Excel 365 REGEX
REGEX exists in newer Excel 365 builds; syntax and availability differ from JavaScript. Treat the spreadsheet cards as starting points, not exhaustive compatibility charts.
We do not ship an AI “plain English → regex” engine, a numeric-range generator, or flavor-specific debuggers—those are intentionally out of scope for v1.
Google Sheets & Excel
Google Sheets uses REGEXMATCH, REGEXEXTRACT, and REGEXREPLACE with RE2 syntax (not every PCRE feature). Microsoft Excel 365 adds REGEX functions in supported builds—confirm names in Insert function for your language pack.
=REGEXMATCH(A1,"\d+")Returns TRUE when any substring matches. Double backslashes in the string literal match a single \ in the regex.
=REGEXEXTRACT(A1,"([A-Z]{2})-\d+")Optional third argument picks which capture to return when you use groups.
=REGEXREPLACE(A1,"\s+"," ")Collapses runs of whitespace—handy after pasting from PDFs or logs.
Frequently asked questions
What does this regex generator do?
It is a browser-local tester: you type a pattern and sample text, choose flags, and see matches and groups. Presets insert common starters. A copy helper builds a REGEXMATCH example for Google Sheets.
Why does Google Sheets disagree with this page?
Sheets evaluates REGEXMATCH with RE2, while this page uses JavaScript RegExp. Many patterns match in both, but advanced constructs may differ or be unsupported in RE2. Use Sheets as the source of truth inside your workbook.
Does Excel work the same way?
Excel 365 REGEX functions are a separate implementation with their own availability and syntax. Confirm in your build and language pack; this page does not emulate Excel line-for-line.
How is this different from regex101 or regexr?
Those sites offer deep per-flavor debuggers, references, and communities. We focus on quick checks plus spreadsheet copy patterns for finance and ops teams—not on replacing a full IDE workflow.
Can a regex freeze my browser?
Yes—catastrophic backtracking is possible with certain patterns. We cap haystack length, match count, and global iterations, and we may stop early with a warning. For untrusted input in production systems, use dedicated sandboxed tools and timeouts.
Do you upload my text?
No. Matching runs entirely in your browser tab; nothing is sent to 10XSheets servers for this tool.
How do I reuse the pattern in Python or Node?
Copy the pattern string, then wrap it in your language’s regex API—for example re.compile(r"…") in Python or new RegExp("…", "g") in JavaScript—mind that flags and escaping rules differ slightly by runtime.
How do I make matching case-insensitive?
Turn on the Ignore case (i) flag here, or add inline (?i) where your engine supports it. In Sheets, you can also wrap with LOWER on both sides for simple cases.
Is this security or compliance advice?
No. It is a free educational helper. For PII, PCI, or regulated pipelines, follow your security team’s review process—never rely on a single browser tool alone.