A ready-to-test pattern for matching phone numbers across common formats.
This tool runs a JavaScript regular expression against a block of text and lists every match with its position, so you can check a pattern is doing what you expect before dropping it into code.
Enter a pattern and optional flags (g for global — required to see every match rather than just the first — i for case-insensitive, m for multiline). The tool re-evaluates on every keystroke, so you can adjust the pattern and immediately see how the match list changes.
If your pattern includes capture groups, each match also shows the captured sub-values, which is useful when you are extracting a piece of a larger string rather than matching the whole thing.
Add the g (global) flag. Without it, JavaScript regex only returns the first match.
JavaScript’s native RegExp engine (ECMAScript regex), which differs slightly from PCRE or Python’s re module in some edge cases like lookbehind support in older environments.
Add the m flag to make ^ and $ match the start/end of each line rather than the whole string.