Regex Tester

Test regular expressions against text and inspect matching results.

Regular Expression

Enter a regular expression and choose the flags you need.

//
g = globali = ignore casem = multilines = dotAllu = unicode

Test Text

Enter the text you want to test against the regular expression.

About Regex Tester

Test regular expressions against text and inspect matches, indexes and capture groups directly in your browser.

How to use Regex Tester

  1. Enter a regular expression pattern.
  2. Enter the regex flags you want to use.
  3. Enter the text you want to test.
  4. Click Test Regex to evaluate the pattern.
  5. Review the highlighted matches and capture groups.

What is a Regular Expression?

A regular expression, commonly called regex or regexp, is a pattern used to search, match, validate and process text. Regex patterns are commonly used for tasks such as form validation, text searching, parsing and extracting information.

Common Regex Flags

FlagMeaning
gFind all matching occurrences
iIgnore differences between uppercase and lowercase
mEnable multiline behavior
sAllow dot to match line terminators
uEnable Unicode-aware matching

Common Regex Examples

Email Example

^[^\s@]+@[^\s@]+\.[^\s@]+$

Numbers Only

^\d+$

Letters Only

^[A-Za-z]+$

Digits and Letters

^[A-Za-z0-9]+$

What are Capture Groups?

Capture groups allow part of a regular expression match to be captured separately. They are created using parentheses in a regex pattern and can be useful when extracting specific pieces of information from matched text.

Regex Match Results

This tool displays each matched value, its position in the test text and any available capture groups. Matching text is also highlighted to make the results easier to inspect.

Regex Safety

Regex evaluation is performed inside a Web Worker so the main page remains responsive. The tester also uses a 500ms evaluation limit to help prevent a problematic expression from running indefinitely.

Input Limits

The regular expression is limited to 1,000 characters, flags are limited to 16 characters and test text is limited to 50,000 characters. These limits help keep regex testing responsive and predictable in the browser.

Is my test data uploaded to a server?

No. Regex evaluation is performed directly in your browser using a Web Worker. The tester does not send the pattern or test text to a KitDevTools server for evaluation.