Code & Format

Regex Test

Write a regex pattern, test it against text; matches are highlighted, capture groups and match counts are listed instantly. Free, client-side.

Regex Test
/ / g
Multiple flags can be selected; active flags are highlighted.
Information

About Regex Tests

Regular expressions (regular expression / regexRegex is a powerful language standard used to search for, verify, or extract specific patterns within text. The same syntax applies to simple checks like email, phone number, or URL verification, as well as more advanced tasks like log file parsing or complex text transformations. This free Regex Test tool lets you instantly test the pattern you've typed on real text.

Tool, global (g), case-insensitive (i), many lines (m), dot-all (s / dotAll) and Unicode (u) It supports the flags. All matching sections are highlighted in color within the text. If there are any matching groups,(group)The values are listed in a separate table with their numbers, so you can easily see which value the group captured. When you enter an invalid pattern, the tool immediately gives a warning and does not crash the application.

All processing happens in your browser; your text is not sent to any server. JavaScript is native. RegExp Because it uses a regex engine, the results are perfectly compatible with JavaScript environments. You can use this tool as a practice area in your regex learning process, or to live test the pattern you will use in your project.

How to use it?

Step by step

  1. Regex Pattern Type the expression you want to test in the box (slash lines) / (without, just the pattern).
  2. According to your needs flags Choose: g all matches, i case-insensitive, m many lines, s dot-all, u Unicode.
  3. Test Text Paste or type the text you want to use to try out the pattern in the designated area.
  4. Results are updated instantly: matches is emphasizedThe number of matches is displayed.
  5. If there are capture groups, under each match Group table It appears; the group number and values are listed.
FAQ

Frequently Asked Questions

g: global — includes all matches, not just the first one. i: case-insensitive — does not distinguish between uppercase and lowercase letters. m: multiline — ^ and $ It is interpreted as a line break/newsline. s: dotAll — dot (.It also maps the newline character. u: Unicode — provides full Unicode support.

When the tool detects an invalid pattern, it displays a red warning message and clears the current result. The application does not crash; the result is instantly refreshed when you correct the pattern.

Sections enclosed in parentheses in your pattern form a capture group: for example (\d+)For each match, the contents of these groups are listed in separate tables as Group 1, Group 2… and so on. Unnamed and named groups ((?<ad>...)) is supported.

Because the calculation is done by your browser's JavaScript engine, it's fast even with text several MB in modern browsers. Very long patterns or expressions with "catastrophic backtracking" may slow down the browser; in this case, refresh the page.

No. Your regex pattern and test text are processed only in your browser; no data is transmitted to or stored on the server.