Skip to content
AldeaCode Logo
Developer100% local · 0 bytes sent

Regex Tester (JavaScript Flavor)

Build and debug JavaScript regular expressions in your browser. Type a pattern, choose flags, and see every match highlighted in the test text along with capture groups and positions. Up to 10,000 matches are returned to keep the UI responsive on large inputs. Once a pattern is solid, run it through Find and Replace Text for bulk edits, use Remove Lines Containing… to filter, or compare two takes with the Text Diff Comparator.

Loading…

How it works

We construct a RegExp from your pattern and flags, then either run exec in a loop (with the g flag) or once (without). Each match is recorded with its index, end, full match string and any capture groups. The test text is highlighted by walking the matches in order.

How to use it

  1. Paste the test string

    Drop in the text you want to match against. Multi-line input is supported, including log lines and CSV rows.

  2. Write your regex

    Enter the JavaScript regex without slashes. Toggle the global, ignore-case, multi-line and dotall flags as needed.

  3. Inspect matches live

    Every match is highlighted in the input as you type. Capture groups are listed with their start and end positions.

  4. Copy the working pattern

    Once your regex behaves, copy it as a string ready to paste into JavaScript, TypeScript, Go, Python or anywhere else.

Use cases

Build a regex to extract emails from a paragraph.

Validate a pattern against edge cases before shipping.

Iterate on a complex capture group structure.

Test a regex from documentation against your real data.

Teach regex syntax with live feedback.

When NOT to use it

  • Against untrusted input on a server. Pathological patterns can cause catastrophic backtracking and freeze your process. Use re2 or run regexes inside a worker with a timeout.
  • For HTML or JSON parsing. Regex cannot handle nested structures correctly. Use a real parser.
  • For validating things that already have a standard library: emails, URLs, IPs. Native validators (e.g. URL constructor, isIP) are more correct.

Your data never leaves your browser

Every utility runs entirely on your device. Nothing is uploaded, nothing is stored on a server. You can disconnect from the internet and they keep working.

Frequently asked questions

Related tools

Curated next destinations. Use complementary tools in a pipeline; alternatives swap in for a different angle; next-step tools pick up where this one leaves off.