Regex Tester
Test a regular expression on sample text and see each match and group.
What it does
Runs a regular expression on your sample text and lists each match with its line, column and capture groups. Writing a pattern by trial and error inside code is slow, so testing it here first saves time. You see how many matches there are and what each group holds.
How to use the Regex Tester
- Type the pattern in Pattern without slashes, for example \d{3}-\d{4}.
- Put the flags in Flags: g for all matches, i to ignore case, m for multi-line.
- Paste the sample text into the Input box.
- Read each match with its line, column and groups, then adjust the pattern.
Related tools
More in Validators
XML Validator
Check that XML is well formed and see the line of each error.
YAML Validator
Find indentation and syntax errors in YAML files.
HTML Validator
Find unclosed tags, wrong nesting and duplicate IDs in HTML.
CSS Validator
Find syntax errors and unknown properties in CSS.
JavaScript Syntax Checker
Find syntax errors in JavaScript and show their line and column.
OpenAPI Validator
Check an OpenAPI 3 or Swagger 2 document for structure errors.
Cron Expression Checker
Read a cron line in plain words and see its next run times.
CSV Validator
Find rows with the wrong number of fields, bad quotes and mixed delimiters.
Regex Tester questions
How do I use the Regex Tester?
Paste the text into the Input box or open a file, set the options, then copy or download the result.