Regex tester
Enter a pattern, set flags, paste some text and see every match and capture group. Nothing is uploaded.
What this tool does
A regular expression describes a text pattern. This tool runs your pattern with the JavaScript engine over the text you paste. It lists each match with its position and shows the value of each capture group. The global flag is added for you so that all matches appear, and you can add flags such as i for case-insensitive or m for multiline.
Invalid patterns show the engine's error message so you can fix them quickly.
How it relates to Alertcat filters
Alertcat has a regex extract filter. It keeps only the text your pattern matches and compares that instead of the whole page. This is useful when the part you need has no useful HTML around it, such as a price inside a paragraph, an order number, or a version string in a changelog.
Patterns like Version\s+(\d+\.\d+\.\d+) or \$\d+(?:\.\d{2})? are typical. Alertcat evaluates patterns on the server with a different regex engine from your browser. Basic syntax behaves the same, but lookbehind, named groups and flags can differ, so test the final pattern in a watch preview.
Regex works on text, so combine it with a CSS or XPath filter first. Narrow the page to the right block, then extract inside it.
Using the result in a watch
- Paste a realistic sample of the text and your pattern, then press Find matches.
- Check that every match is wanted and nothing is missed. Anchor or tighten loose patterns.
- Copy the pattern into the regex extract field of the watch.
- Run a check and confirm the snapshot shows only the extracted text.
Frequently asked questions
Which regex flavour does Alertcat use?
The server uses its own engine, which is close to the common syntax shown here. Test critical patterns in the watch preview.
Why do I only see one match when I expect several?
Make sure the pattern is not anchored with ^ and $ without the m flag.
Can regex parse HTML?
Not reliably. Use a CSS selector or XPath to pick the element, then regex on its text.
Test a regular expression
Related
Watch the pages that matter
Alertcat is in early access. Tell us what you want to watch and we will set up your team.