Regex Tester
betaThis free regex tester lets you build and debug regular expressions against your own sample text, with matches highlighted live as you type. Inspect numbered and named capture groups, toggle flags, and copy the equivalent code for the language you actually use — JavaScript, Python, PHP (PCRE), Java, Go, C#/.NET or Ruby — with warnings when a pattern behaves differently in that flavor. Matching runs entirely on your device.
Test a regular expression against sample text with live match highlighting, then copy the equivalent code for your language. Everything runs in your browser.
Contact: alice@example.com, bob@work.co.id Support: team@PDFPowerHub.com Invalid: not-an-email @ nope
⚠ Python names groups with (?P<name>…), not (?<name>…).
How to use Regex Tester
- 1 Type your regular expression and toggle the flags you need (g, i, m, s, u, y).
- 2 Paste the text you want to test against — matches highlight instantly.
- 3 Check the match list for capture groups, named groups and positions.
- 4 Pick a language to copy ready-to-use code, and read the flavor notes for cross-language gotchas.
Frequently asked questions
Which regex engine does the tester use?
Matching runs on your browser's native JavaScript regular-expression engine, so results are instant and your data never leaves your device. For other languages we generate the equivalent code and warn about syntax that behaves differently.
Does it support Python, Java, Go and PHP regex?
Yes — pick your language to get an idiomatic code snippet (Python re, PHP PCRE, Java Pattern, Go regexp, C# Regex, Ruby) with the flags mapped correctly, plus notes on differences like Go's lack of lookbehind or Python's (?P<name>) group syntax.
Are my patterns or test data sent to a server?
No. Everything runs locally in your browser, so it is safe to test against private logs, emails or other sensitive text.
What do the flags mean?
g = global (find all), i = ignore case, m = multiline (^ and $ per line), s = dotall (dot matches newlines), u = unicode, y = sticky. Toggle them and the highlighting updates instantly.
Does it show capture groups?
Yes. Each match lists its numbered capture groups ($1, $2, …) and any named groups, along with the match position in the text.