How to Use the Regex Tester: Steps and a Worked Example
Test a JavaScript regular expression against sample text and list matches. This guide shows what to enter, a worked example, and the limits to keep in mind. The Regex Tester tool is free, needs no account and runs in your browser.
What you need
- Regular expression, for example \btool\w*
- Test text, for example Useful tools make work easier. This tool checks a pattern.
- Flags (g, i, m, s, u), for example gi
Step by step
- Open the Regex Tester tool.
- Fill in Regular expression.
- Fill in Test text.
- Fill in Flags (g, i, m, s, u).
- Read the result, which updates as soon as the inputs change.
Worked example
With these inputs:
- Regular expression: \btool\w*
- Test text: Useful tools make work easier. This tool checks a pattern.
- Flags (g, i, m, s, u): gi
the tool returns:
Match 1: “tools” at index 7
Match 2: “tool” at index 36
How it works
The calculation is: JavaScript RegExp. Everything runs in your browser, so nothing you type is uploaded.
Things to keep in mind
Uses JavaScript regular-expression syntax. Patterns can be computationally expensive; avoid untrusted patterns on huge text.
Related tools
If this is not quite what you need, try Regex Escape Helper, JSON Formatter or JSON Validator.