Tool

Regex Tester

Test regex patterns and match groups quickly.

View all tools

When to use it

  • Use it to test whether a pattern matches text before writing code.
  • It is useful for checking capture groups and match positions.
  • It helps with validation, extraction, and search rules.

Types and modes

  • g finds all matches in the text.
  • i ignores letter case.
  • m changes how ^ and $ work across multiple lines, and s lets dot match line breaks.

What to check

  • Capture groups are values wrapped in parentheses.
  • A broad pattern can match more than you expect.
  • Flag combinations can change the result a lot.

FAQ

Why is there no match even though the pattern looks right?

Flags, line breaks, or greedy matching may still prevent the expected result.

What are capture groups for?

They let you extract or reuse specific parts of a match.

Enter a pattern, toggle flags, and test it against your text.
Matches
Matches3
foo12index: 0
[
  "foo"
]
bar34index: 10
[
  "bar"
]
foo99index: 16
[
  "foo"
]

Matches include positions and capture groups when available.