Test regular expressions online with match highlighting, capture groups and pattern presets. Inspect JavaScript regex behavior in PSDevTool.
The interactive workspace opens with JavaScript.
Read the tool guide ↓Check a regular expression against representative text before using it in code. Regex Lab highlights matches and exposes groups so you can understand what the pattern captures.
PRACTICAL WALKTHROUGH
Build a pattern against small representative examples before using it on a whole log. Include both a string that should match and one that should not, and inspect captured groups rather than checking only whether some match exists.
Pattern: order-(\d+) Flags: g Text: order-42 and order-105; order-x
The full matches are order-42 and order-105. Capture group 1 contains 42 and 105. order-x does not match.
The numeric group accepts one or more digits; it does not accept letters. If only a whole field is valid, anchor the pattern to the start and end of that field. The global flag searches for multiple matches and changes how many results you inspect.
Not necessarily. Regex engines differ. This browser tool tests JavaScript regex behavior, so check the target language’s rules before copying a pattern.
Check flags, greedy quantifiers, anchors and your test text. Capture-group output can help reveal which section of the pattern consumed the text.