Free online regex tester
This regex tester lets you build and debug regular expressions in real time. Type a pattern, toggle the flags you need, and paste some sample text — every match is highlighted instantly, counted, and listed with its position and capture groups. It uses your browser's native JavaScript engine, so what you see here is exactly what your code will do. It's ideal for validating input, extracting data, cleaning up messy text, and learning how regular expressions behave.
How to test a regular expression
- Type your pattern in the Regular expression box (no slashes needed).
- Tick any flags you want, such as
gfor global orito ignore case. - Paste or type your sample text into the Test string area.
- Read the highlighted matches, the total count, and each capture group below.
- Use Copy matches to grab every matched value at once.
Understanding the flags
Flags change how the whole pattern is applied. g returns all matches, i makes matching case-insensitive, m and s control how line breaks are treated, u enables full Unicode support, and y anchors matching to a fixed position. If your pattern is invalid, a red message shows the exact error so you can fix it quickly.
Related tools
Once your text is extracted, you can tidy it further: turn a title into a clean permalink with the slug generator, or check structured output in the JSON formatter. Everything runs locally in your browser, so your patterns and data never leave your device.