Regex Tester — Regular Expression Tester & Debugger
Test and debug regular expressions online. Real-time regex matching with match highlighting and group capture visualization.
💻 Developer Tools
✅ Free
By SwiftCalcTools Editorial Team · Formula verified
Loading Regex Tester…
Preparing your calculator
How to Use Regex Tester
- 1Enter the required values in the input fields above.
- 2Click the Calculate button or results update instantly as you type.
- 3View your results in the output panel below the inputs.
- 4Adjust any values to recalculate instantly.
Frequently Asked Questions
g (global): find all matches, not just the first. i (case-insensitive): A matches a. m (multiline): ^ and $ match line starts/ends, not just string start/end. s (dotAll): . matches newline \n (by default it doesn't). x (extended, not in JS): ignore whitespace for readability. In JavaScript, you can combine flags: /pattern/gim.
Email (basic): /[\w.-]+@[\w.-]+\.[a-z]{2,}/i. Phone (India): /[6-9]\d{9}/. URL: /https?:\/\/[\w-]+(\.[\w-]+)+[\S]*/i. Date (YYYY-MM-DD): /\d{4}-\d{2}-\d{2}/. IP address: /\b\d{1,3}(\.\d{1,3}){3}\b/. HTML tag: /<[^>]+>/g. Whitespace trim: /^\s+|\s+$/g. Word boundary: \b matches between word and non-word characters.
.* is greedy — it matches as many characters as possible. .*? is lazy (non-greedy) — it matches as few characters as possible. Example: on "start <b>bold</b> end", <.*> matches the whole <b>bold</b> (greedy). <.*?> matches just <b> (lazy, stops at first >). Use lazy quantifiers when you want the shortest possible match.
Parentheses () create capturing groups that capture the matched substring. \1 backreferences the first group. Example: /(\w+)\s+\1/ matches repeated words like "the the". (?:...) is a non-capturing group (groups without saving). Named groups: (?<name>...) lets you reference by name. Groups appear in the match result and are shown in this tester's match table.