AlpaKit Logo AlpaKit

Regex Tester & Helper

Test regular expressions with real-time highlighting and common syntax presets.

Common Regex Presets

Regular Expression (Pattern)
/ /
Flags:
Test Text
Highlighted Match Matched 0 results
Match Details
No matches found.

How to use this tool

  1. 1 Open Regex Tester & Helper, then enter, paste, or choose the content you want to process.
  2. 2 Adjust the available options and output format for your task.
  3. 3 Review the instant result, then copy or download the available output.

Common use cases

Test regular expressions with real-time highlighting and common syntax presets. Use it for everyday work, development, learning, or quick verification.

Privacy and data handling

This tool runs in your browser. Before working with sensitive data, make sure you trust your browser and device environment.

Online regex tester: live match highlighting, capture groups and presets

This regex tester runs your pattern with the browser’s built-in JavaScript RegExp engine. Type a regular expression at the top, paste test text below, and every match is highlighted live, with a running match count. The Match Details list shows each match, its index range in the text (for example Index: 12-27) and the value of every capture group (Group 1, Group 2…), so you can see at a glance whether your parentheses capture what you think they capture.

Toggle the g flag to find all matches (without it, only the first match is returned), i to ignore case, and m for multiline mode, where ^ and $ match at the start and end of each line. If the pattern is invalid, such as an unbalanced parenthesis or a quantifier with nothing to repeat, the tool shows the browser’s syntax error message instead of silently returning nothing, and re-runs as soon as you fix it.

Five presets give you a starting point: email address, Taiwan mobile number (10 digits starting with 09), IPv4 address (each octet 0–255), Taiwan national ID format, and a strong-password check (at least 8 characters with uppercase, lowercase and a digit). One click loads the pattern, flags and sample text so you can adapt it. Note that the ID preset only checks the shape, one letter, then 1 or 2, then eight digits, and does not verify the checksum digit; the email pattern is a practical approximation, not the full RFC grammar.

Because it uses JavaScript syntax, it is ideal for front-end form validation, Node.js scripts and browser extensions. Most basics carry over to Python, PHP (PCRE), Java or SQL, but some advanced features such as possessive quantifiers, atomic groups or the \A and \Z anchors are engine-specific, so results can differ. All matching happens in your browser; your test text is never uploaded.

Frequently asked questions

Why doesn’t \w match accented letters or Chinese characters?

In JavaScript, \w means only [A-Za-z0-9_], \d means only 0–9, and \b uses \w to decide word boundaries. Letters such as é, ñ or any CJK character are not word characters. Match them explicitly, for example [\u4e00-\u9fff]+ for common Chinese characters or [A-Za-zÀ-ÿ]+ for Latin-1 letters.

What happens if I turn off the g flag?

Only the first match is found, so the counter shows at most 1. Turn g on to find every occurrence, for example to extract all email addresses. This mirrors JavaScript itself, where match() and replace() without g handle only the first match.

Will a regex tested here work in Python or PHP?

Usually, for the common parts: character classes, quantifiers, groups and lookaheads like (?=…) behave the same. Differences show up in delimiters (PHP needs /…/), flag syntax and advanced PCRE-only features. Confirm the logic here, then run it once in your target language.

Can I use this tool to replace text?

No. This tool focuses on testing and inspecting matches: highlighting, counts, indexes and capture groups. For plain find-and-replace across a block of text, use the Text Cleaner tool on this site.

Browse this category: Dev Tools

Suggested & Recent Tools
    ↑ ↓ Navigate ↵ Open ESC Close
    咩~
    Alpa Idle Alpa Walk 1 Alpa Walk 2 Alpa Walk 3 Alpa Walk 4 Alpa Dizzy Alpa Sleep