How do I use the regex tester?
- Type the pattern without slashes.
- Add flags such as g, i or m.
- Paste the text to search and press Test pattern.
Regex tester: frequently asked questions
Which regex flavour does this use?
JavaScript (ECMAScript), as in browsers and Node.js. Most syntax also works in PCRE and Python, with small differences.
How do I match Arabic text?
Use the u flag with a Unicode property escape such as \p{Script=Arabic}.
What is a regular expression?
A pattern for matching text, used for validation, search and replace, and extracting data.
Which regex flavour does the tester use?
JavaScript regular expressions, as used in browsers and Node.js.
What do the g, i and m flags do?
g finds all matches, i ignores case, and m makes ^ and $ match at each line.
How do I match a UAE mobile number?
A simple pattern is ^(?:\+971|00971|0)5[0-9]{8}$, which accepts 05X and +9715X formats.
Can regex match Arabic text?
Yes. Use the u flag and Unicode ranges such as \u0600-\u06FF, or \p{Script=Arabic}.
Should I validate emails with regex?
Only loosely. Check for a basic shape, then confirm the address by sending an email.
Why is my regex slow?
Nested quantifiers can cause catastrophic backtracking. Make patterns more specific.
What are capture groups?
Parts of a pattern in parentheses whose matched text you can reuse in replacements or code.