Pattern & Test String
/
/
Replace with:
Matches
Matches will be highlighted here.
Match Details
No matches yet.
No matches yet.
Regex Tester runs a regular expression against your text in real time, highlighting every match and showing the capture groups, so you can build a pattern by watching it work rather than by guessing.
By default quantifiers are greedy: they match as much as possible and then give characters back only if the rest of the pattern fails. That is why matching an HTML tag with an angle bracket, dot-star, angle bracket swallows everything from the first opening bracket to the last closing one.
Adding a question mark makes a quantifier lazy, so it matches as little as possible. That single character is the fix for the majority of patterns that match far more than intended.
v1.0