Regex Tester: Regex flavour used
Start with the task you actually need to finish
- Building and testing a validation pattern for email addresses or phone numbers.
- Debugging why a regex used in a form validator is rejecting valid input.
- Designing a search-and-replace pattern before running it across a codebase.
Follow the workflow and review the result
- Type or paste your regular expression pattern into the pattern field.
- Toggle flags such as g (global), i (case-insensitive) or m (multiline) as needed.
- Paste your sample text into the test string area.
- Review the highlighted matches shown live in the text.
- Check the capture groups panel to see what each group captured for every match.
- Adjust the pattern and repeat until the matches are exactly what you need.
Regex flavour used
This tool uses JavaScript's built-in (ECMAScript) regular expression engine, the same one used by Node.js and every modern browser. This includes support for named capture groups such as (?<year>\d{4}), and lookahead and lookbehind assertions in current browser versions.
Understanding flags
The g flag finds all matches instead of stopping at the first one, i makes matching case-insensitive, m changes ^ and $ to match the start and end of each line rather than the whole string, and s allows . to match newline characters. Combining flags like gi is common for global, case-insensitive searches.
Common regex mistakes
Forgetting to escape special characters like . or ( when they should be literal is a frequent source of unexpected matches. Overly greedy quantifiers such as .* can also match far more text than intended; switching to a non-greedy .*? or a more specific character class usually narrows the match correctly.