Regex Tester
Test regex with live highlighting and Thai presets.
[A-Za-z0-9._%+-]character set — matches one character in: A-Za-z0-9._%+-+one or more times@literal "@"[A-Za-z0-9.-]character set — matches one character in: A-Za-z0-9.-+one or more times\.literal "."[A-Za-z]character set — matches one character in: A-Za-z{2,}2 or more times
ติดต่อ k@dev.holiday หรือ real.k@example.co.th ได้เลย
- #1k@dev.holidayat 7
- #2real.k@example.co.that 26
.- any character except newline
\d- digit (0–9)
\D- non-digit
\w- word character (a–z, A–Z, 0–9, _)
\W- non-word character
\s- whitespace (space, tab, newline)
\S- non-whitespace
[abc]- any of a, b, or c
[^abc]- none of a, b, or c
[a-z]- any character in the range a to z
Common questions
Is my pattern or text uploaded?
No. The expression runs against your text entirely in your browser using the built-in JavaScript regex engine, so neither the pattern nor the test string leaves your device.
Are all matches highlighted, even without the g flag?
Yes. For highlighting and the match list the tool always iterates over every match, so you see them all. The other flags you set — i for ignore case, m for multiline, s for dotall, u for unicode — apply as written.
What are the Thai presets?
One-click patterns for the data Thai forms use most: mobile number, national ID, postal code, Thai and English full names, email, URL, dates, and IP addresses. Each preset loads a sample so you can see it match right away, and the selected preset stays highlighted.
Why do the mobile and national ID presets only match digits?
They match contiguous digits with no separators — a 10-digit mobile number like 0991112222 and a 13-digit national ID like 0000000000001 — so they line up with the plain values most systems store and validate against. Strip dashes and spaces from your text first, or adjust the pattern to allow them.
How do the name presets work?
The Thai and English name presets are validation-style patterns anchored with ^ and $. The Thai preset accepts only Thai characters and spaces, and the English preset accepts only A–Z letters and spaces, so a whole line matches only when every character is allowed.
What do the explanation and quick reference panels show?
The explanation panel breaks your current pattern into tokens and describes each one in plain language, updating live as you type. The quick reference is a cheat sheet of common regex syntax — character classes, anchors, quantifiers, groups, escapes, and flags — grouped the way regex101 lays them out.
What flavour of regex is this?
It is JavaScript (ECMAScript) regular expressions, the same engine your browser and Node use. Patterns that rely on other flavours, such as PCRE-only lookbehind tricks, may behave differently.