1001Ferramentas
.* Dev

Regex Tester

Test regular expressions in real time. See highlighted matches and captured groups.

/ /

How to use?

Paste your regular expression in one field and the test text in the other. As you type, the matches get highlighted. To fine-tune the result, lean on the flags. The g flag finds every occurrence (global), i ignores upper and lower case (case-insensitive), and m treats each line on its own (multiline).

Test regular expressions live

Regular expressions are powerful, yet notoriously hard to get right the first time. This tester makes the process visual. You write the pattern on one side, paste the test text on the other, and see at once which parts match, highlighted right in the content.

Captured groups show up separately, which helps you understand exactly what each part of the expression is grabbing. It makes all the difference when you're extracting data, validating formats or building a replacement. Changed the pattern? The result updates in real time, so you keep refining until you get there.

It all happens in the browser, with no text leaving your machine. A safe, quick way to work the kinks out of a regex before you drop it into your code.

Frequently asked questions

Why do I still see every match after deleting the g flag?
The tester appends g internally before running your pattern, since that is how it walks the whole text and highlights each hit. The only flags the field really honours are g, i, m, s, u and y; any other letter you type, such as d or x, is dropped without warning. Keep that in mind if your code relies on a non-global regex, where lastIndex advances on every call.
Does the captured-groups panel cover every match?
No. It lists the groups of the first match only, numbered 1, 2 and so on. Named groups show up by position rather than by name, and a group that did not take part in the match is printed as undefined. To inspect a later occurrence, cut that fragment of text out and test it on its own.
Does the syntax tested here carry over to Python, PHP or grep?
The engine is the browser JavaScript one, so whatever passes here runs in JS unchanged. Other flavours diverge fast: JavaScript has no verbose mode, does not recognise the backslash-A and backslash-z anchors, and lookbehind support depends on the browser version. Check the escapes and character classes of your target flavour before pasting a pattern into PCRE or grep.

Related Tools