Skip to content

Regex Tester

Try a JavaScript regular expression with common flags and review each match's text, index, and capture groups.

  • Free
  • No sign-up
  • Runs in your browser
Flags

No matches found. If the input is empty, a regex may still match an empty string.

Patterns run in a temporary browser worker and are stopped if they take too long. Test text is not uploaded or saved.

All processing happens in your browser — files never leave your device. Your input stays in this browser and is not uploaded to Smart Online Tools.

How it works

  1. Enter a pattern without surrounding slashes.
  2. Choose flags and paste test text.
  3. Select Test regex to review matches.

Good to know: Testing runs in a temporary browser worker with a time limit. Complex patterns may be stopped if they run too slowly. Pattern and test text are not saved or sent.

Test a regular expression

Enter a JavaScript pattern without its surrounding slash characters, choose flags such as global or case-insensitive, and review each match's text, character index, and capture groups. Patterns run in a separate worker so a slow expression can be stopped without freezing the page.

Regular expressions are useful for quick text checks, but complicated patterns can be hard to maintain. Test representative examples and edge cases, and use a parser or validator when you need to check a complete programming language or file format.

Testing regular expressions

This tester uses the JavaScript regular expression engine, so syntax matches what browsers and Node.js support. Flags change behavior: g finds all matches, i ignores case, m makes ^ and $ match at line breaks, and s lets the dot match newlines.

Regex syntax varies between languages. Lookbehind, named groups and Unicode classes are supported in modern JavaScript, but a pattern written for PCRE, Python or .NET may need changes. Test with realistic sample data, including cases that should not match.

Patterns with nested repetition, such as (a+)+, can take extremely long on some inputs. The tester stops runs that take too long.