About Regex Tester
This regex tester shows what a regular expression really matches before you put it in code, a spreadsheet formula or a find-and-replace dialog. Type the pattern between the slashes, paste test text below, and every match is highlighted as you type, with a running count. If you only need emails, links or phone numbers, Extract Emails, Links and Numbers finds them without writing a pattern.
The Matches and groups list shows each match with its numbered groups ($1, $2) and named groups, and Replace with previews a substitution on the whole text. Flags g, i, m, s and u are one click each, and hovering over them shows what they do. The engine is the one in your browser, so patterns behave exactly as in JavaScript. Invalid patterns show the error message at once.
How to use Regex Tester
- 1Enter the pattern
Type the regex between the slashes, without the slashes themselves.
- 2Set the flags
g and u are on by default. Add i, m or s as needed.
- 3Paste test text
Paste text or open a file, and the regex tester highlights every match.
- 4Check groups and replace
Read the groups in Matches and groups, and try a replacement with $1.
Why use Cubfile for this
- Live highlighting
Matches light up in the text as you type the pattern.
- Groups laid out
Numbered and named groups for up to 300 matches, in a readable list.
- Replacement preview
See the whole text after replacing, with $1-style references.
- JavaScript flavor
Lookbehind, named groups and Unicode property escapes work as in modern browsers.