Toolinho ← Back to Home
πŸ”

Regex Tester

Test and debug your regular expressions

0
Matches
0
Groups

About Regex Tester

A regular expression describes a text pattern: what to match, how many times, and where. This tester runs your pattern against sample text as you type and highlights every match, so you can develop the expression incrementally instead of guessing.

What the flags do

Flags change how the whole pattern is applied. g (global) finds every match rather than stopping at the first. i makes matching case-insensitive. m (multiline) changes ^ and $ so they anchor to the start and end of each line rather than the whole string β€” useful when your input is a list of lines.

Worked example: \d{3}-\d{4} matches 555-0123. \d means a digit and {3} means exactly three of them, so the pattern reads: three digits, a hyphen, four digits.

Why doesn’t my pattern match across lines?

Because . matches any character except a newline by default. Multiline mode does not change that β€” it only affects the ^ and $ anchors. To make the dot match line breaks you need the s (dotAll) flag, or an explicit character class such as [\s\S].

Why is my expression matching too much?

Quantifiers are greedy: .* takes the longest run it can and only gives characters back when the rest of the pattern fails. Extracting a value between two markers usually needs the lazy form .*?, which stops at the first opportunity, or a negated character class that cannot cross the closing marker at all.

Try our other free tools: JSON formatter, hash generator, and base64 encoder.