Regular Expressions for Beginners: A Practical Start
The handful of regex building blocks that cover most everyday matching, explained without jargon.
Regular expressions are powerful and easy to get wrong. A tester lets you try a pattern against realistic text before it goes into production, where a subtle error becomes a bug.
This tool uses JavaScript's regular expression engine, so the results match what you would get in the browser or Node.js. Matches, positions and capture groups are listed below.
Runs locally in your browser — nothing is uploaded.
JavaScript (ECMAScript). Lookbehind and named groups work in current browsers; some older engines may not support them.
Add the g flag. Without it, the engine stops after the first match.
No. The pattern and text are evaluated locally and never uploaded.
Regular expressions are written once and read many times, which is why a pattern that is hard to explain is usually wrong. If you cannot describe the match in one sentence, split the task into two patterns or handle it in code.
The tester shows positions and capture groups, which is usually enough to find the bug. Remember that JavaScript flags change behaviour: without the global flag the engine stops at the first match, and without the multiline flag anchors apply to the whole string.