Regex Tester
Test and debug regular expressions with live highlighting, capture groups, and replacement preview.
01Why this regex tool
Regex you can see working.
Four reasons devs and data folks build their patterns here before pasting into code.
- 01
Live highlighting as you type
Edit the pattern or the test string and matches light up in place. No 'Run' button, no waiting.
- 02
Capture groups, named and numbered
Inspect every capture for every match. Named groups show their key; numbered groups show their position.
- 03
Replacement preview
Type a replacement string with $1, $2, or $<name> placeholders and see the rewritten output beside the matches.
- 04
Browser-native engine
Runs on the same regex engine your code will use in production. What you see here is what your app will get.
02How it works
Pattern, sample, match.
- Flagsgim
Step 1Enter your pattern
Type the regex into the pattern field. Pick flags — g for global, i for case-insensitive, m for multiline.
- Test input1Email: ada@wire.dev2Email: dev@wirelogs.com
Step 2Paste your test string
Drop in the sample text you want to match against. Matches highlight as you tweak the pattern.
- CopiedMatchesada@wire.dev · dev@wirelogs.com2 matches · live
Step 3Read matches or replace
See each match in the list with its capture groups. Add a replacement string and the rewritten output appears live.
03Use cases
Where regex belongs.
Input validation, log parsing, search-and-replace — the everyday regex jobs.
Validate user input
Designing a form? Write the email or phone regex here against real samples (good and bad) before pasting into your validator.
Email regex · pass/fail samplesFind-and-replace in code
Sweeping a refactor across a file? Test the pattern + replacement here, then run the same regex in your editor with confidence.
Old API call → new shapeParse log lines
Pulling fields out of unstructured logs. Test capture groups on a real sample before wiring up the parser.
Log line → request id, statusDebug an existing regex
Inherited regex isn't matching what it should? Drop it in, paste failing samples, see exactly where it stops matching.
Inherited pattern · failure casesBuild a router pattern
Express, Next.js, or any framework route regex. Test against the URLs you actually expect and the ones you want to reject.
Route regex · 6 URL samplesStrip unwanted characters
Cleaning up scraped or imported text — remove markdown, strip ANSI color codes, normalize whitespace.
Markdown headers → plain text
04Quick tips
Write regex that holds up.
Four habits that keep patterns readable and fast.
- 01
Use named groups for readability
(?<year>\d{4}) reads better than (\d{4}) six months from now. Most engines support it, including JavaScript.
- 02
Beware catastrophic backtracking
Patterns with nested quantifiers like (a+)+ can take exponential time on adversarial input. If your regex is slow, this is usually why.
- 03
Escape regex metacharacters
. + * ? ( ) [ ] { } | \ ^ $ all have special meaning. Escape them with backslash when you want the literal character.
- 04
Use g for all matches, not just one
Without the g flag, the engine stops at the first match. With it, you get every match in the string.
05Loved by
Backend, data, and frontend.
Build the pattern here, paste into the codebase, ship. Beats writing print statements after every tweak.
Log-parsing regex with named captures. The live highlight catches a missing escape character before I run anything.
Form validators tested against real inputs before they ship. Catches the edge cases the unit tests don't think to try.
06Questions
Regex, plainly answered.
Questions before your first match. Missing one? hello@wirelogs.com.
01Which regex flavor does this use?
JavaScript regex — the same engine that runs in Chrome, Firefox, Safari, and Node.js. Patterns you build here will behave the same way in any JS or TS code.
02Does it support named capture groups?
Yes. (?<name>pattern) creates a named group; access it with match.groups.name or via $<name> in a replacement string.
03Is multiline supported?
Yes. Add the m flag to make ^ and $ match at line boundaries. Add the s flag to make . match newlines.
04Can I test very long inputs?
Yes, but watch out for patterns prone to catastrophic backtracking — they can hang the tab on inputs with the wrong shape. Add anchors and avoid nested quantifiers.
05Does my regex or test string leave the browser?
No. All matching happens locally. Wirelogs never sees what you paste — useful for testing patterns against real production samples.
06Is it free?
Yes. No sign-up, no usage cap, no watermark.
Ready when you are
Make the pattern work.
Paste your pattern and sample text above. Tweak until the highlights look right, then ship.
- Livehighlighting
- Localprivate
- $0now and always