Skip to content
EverydayInstantTools

Regex Tester

Test regular expressions online against sample text and see every match and capture group.

Flags
Examples:

Testing regular expression…

Test regular expressions online

Regular expressions (regex) are patterns used to search, match and validate text. This tester lets you experiment with JavaScript-compatible regex patterns and inspect matching text, positions and capture groups.

How to use the regex tester

  1. Enter a regular expression pattern.
  2. Select the flags required for your pattern.
  3. Paste or type sample text into the test area.
  4. Review the matches, positions and capture groups.
  5. Adjust the pattern and sample text to test different cases.

Common regex syntax

PatternMeaningExample
\dA digit from 0 to 942
\wA word characterhello
\sA whitespace characterSpace or tab
.Any character except line terminators by defaulta, 5, #
*Zero or more repetitionsab*
+One or more repetitions\d+
^Start of input^Hello
$End of inputworld$

Common regular expression flags

  • g — Global: Finds all matches instead of stopping after the first match in normal JavaScript matching.
  • i — Case-insensitive: Matches letters without distinguishing uppercase and lowercase.
  • m — Multiline: Changes how the start and end anchors behave across multiple lines.
  • s — DotAll: Allows the dot character to match line terminators.
  • u — Unicode: Enables Unicode-aware pattern processing.

Useful regex examples

Find numbers

\d+

Matches 25, 100 or 2026.

Find whitespace

\s+

Matches one or more whitespace characters.

Find a word at the start

^Hello

Matches Hello when it appears at the beginning of the input.

Find a simple email-like pattern

[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}

Matches many common email address formats, but does not guarantee that an address exists or is deliverable.

Common uses of regular expressions

  • Finding specific words or numbers in large text files.
  • Checking input formats in web applications.
  • Extracting values from logs and structured text.
  • Replacing or identifying repeated text patterns.
  • Testing patterns before using them in application code.

Which regex syntax does this tool support?

This tester uses JavaScript-compatible regular expressions provided by your browser. Other languages and regex engines may support different syntax or behave differently, so test patterns in the environment where you intend to use them.

Test patterns privately

Regex matching happens in your browser. Your pattern and sample text are not sent to our server. Match collection is also capped to help prevent problematic patterns from overwhelming the page.

Frequently asked questions

Which regex dialect does this use?
JavaScript-compatible regular expressions, as implemented by your browser. Regex syntax is not identical across languages — patterns that work here may behave differently in Python, PCRE, Java, or Go, particularly around lookbehind, named groups, and Unicode escapes.
What happens if my pattern is invalid?
The error from the regex engine is shown and no matches are listed. The page keeps working, so you can fix the pattern and carry on.
Why does it show matches even without the g flag?
So the match count stays meaningful, the tester always scans the whole input. The g flag still matters when you use the pattern in your own code, which is why it's shown as a toggle.
Is my test text sent anywhere?
No — the pattern and text are evaluated in your browser and never leave the page.