Regex Tester & Log Extractor

Test JavaScript regular expressions against pasted text or uploaded log files. Inspect highlighted matches, capture groups, quick patterns, and CSV or JSON exports.

/…/ Pattern
/ /gm
≡ Log input
0 lines
◈ Extracted matches
Matches will appear here…

How to Use the Regex / Log Extractor

  1. Enter a pattern — Type a regex in the pattern bar, or click a Quick Pattern from the sidebar to load it instantly.
  2. Paste log text — Paste your log content into the text area. Matches highlight in real time with color-coded capture groups.
  3. Export results — Click → CSV or → JSON to download all extracted matches. Groups are included as separate columns.

How It Works: ECMAScript Regex Engine & Pattern Evaluation

What is a Regular Expression Tester?

A regular expression tester is an interactive debugging tool that compiles search patterns against sample text using the browser's native ECMAScript RegExp engine, capturing token groups and evaluating match offsets in real time. It enables developers to inspect matches, test boundaries, and validate complex parsing rules.

How It Works in the Browser

Our regex workbench compiles patterns in the client runtime using standard V8/SpiderMonkey regex engines for authentic JavaScript runtime parity:

  1. Pattern Compilation & Flag Handling: The input pattern is instantiated via new RegExp(pattern, flags) using the ECMAScript RegExp engine, evaluating global (g), case-insensitive (i), multiline (m), dotAll (s), and unicode (u) flag handling.
  2. Match Group Capturing: The engine iterates through text matches, performing match group capturing for numbered indices and named capture groups along with exact start and end offsets.
  3. Non-Destructive Highlighting: Text slices are wrapped in semantic highlight tags with alternating contrast backgrounds to differentiate consecutive adjacent matches.
  4. Safety Evaluation: Evaluation occurs with execution limits to prevent browser lockup from catastrophic backtracking in non-deterministic finite automata (NFA).

Key Specifications & Engine Standards

The tester operates under the official ECMAScript RegExp (ECMA-262) engine specification. It fully supports lookahead ((?=...), (?!...)) and lookbehind ((?<=...), (?) assertions, robust match group capturing ((?<name>...)), comprehensive flag handling (gimsuy), Unicode property escapes (\p{...}), and backreferences. All execution runs locally with zero network latency or text transmission.

Features

  • Live match highlighting as you type
  • Color-coded capture groups (up to 4 groups)
  • Quick pattern library — IP, email, date, UUID, and more
  • Export all matches to CSV or JSON
  • Supports g, i, m, s flags
  • Upload .log / .txt files directly
  • Uses the browser JavaScript RegExp engine
  • Collects up to 5000 matches and shows up to 200 detailed rows

Regex Tester: JavaScript matches, groups, and exports

Use Regex Tester to try a JavaScript regular expression against pasted text or a log file. The page highlights matches, lists capture groups, and lets you export extracted matches as CSV or JSON.

Example workflow

Paste an application log, choose the HTTP status quick pattern, toggle flags if needed, and export the matched rows with capture groups for further analysis.

Limits to check

  • Regex flavor: Patterns use JavaScript RegExp, so PCRE-only syntax may fail.
  • Large logs: Uploaded files over 10 MB trigger a warning and may be slow to process.
  • Match cap: The script collects up to 5000 matches and displays up to 200 detailed rows.

For the next step, try JSON Formatter & Validator, Base64 Encoder & Decoder, Hash Generator, Unix Timestamp Converter.

Frequently Asked Questions

What does the g flag do? +
The g (global) flag lets the tester collect matches throughout the string. The page also adds global matching internally when it needs to list all matches.
How do capture groups work? +
Wrap parts of your pattern in parentheses () to create capture groups. Captured values are shown with each match. Named groups use (?<name>...) syntax when supported by the browser.
How do I export matches? +
Click CSV to download one row per match with capture groups in separate columns, or click JSON to download the extracted match objects.
What regex flavor does this use? +
This tester uses the browser's JavaScript RegExp engine. PCRE-only syntax or features not supported by the current browser may fail.
Can I test against large log files? +
Yes, but very large logs can be slow in the browser. The page warns when an uploaded file is over 10 MB, collects up to 5000 matches, and shows up to 200 detailed match rows.