Regex Tester With Arabic Support

Test any regular expression on your text live: matches highlighted, groups in a table, with presets for Arabic words, Saudi mobiles, emails and dates.

Test an expression
/[\u0600-\u06FF]+/guمرحباًHello 20261 match

Tester

Quick cheat sheet

\d \w \sdigit, word char, space
[\u0600-\u06FF]any Arabic letter
^ $start and end of line
a{2,4}2 to 4 times
(abc)capturing group
a|bthis or that

Regex and Arabic text

The u flag

Always enable it with Arabic so characters are handled as full Unicode.

The letter range

[\u0600-\u06FF] covers Arabic letters, diacritics and Arabic-Indic digits.

\w is not enough

In JavaScript \w does not match Arabic letters; use the range instead.

Example: validating a mobile number in a form

Pick the Saudi mobile preset to see a pattern accepting 05XXXXXXXX and +9665XXXXXXXX. Copy it into an HTML input pattern or your PHP validation, and test right and wrong numbers here before publishing.

Key terms

Short definitions of what you meet along the way.

Regex
A compact language for describing text patterns, to search, validate and replace.
Capturing group
A part in () saved for use after matching.
Flags
Letters that change behaviour: g for all, i ignore case, u for Unicode.

Frequently asked questions

Did not find your answer? Ask us on WhatsApp

Do they work the same in PHP?

Mostly. In PHP add the u modifier to preg_match for Arabic.

Why does \b not match Arabic words?

Word boundaries rely on English \w. Use spaces or the Arabic range.

Is my text sent anywhere?

No. Testing happens in your browser.

Building a system or app?

We build custom systems and APIs for your business.

Contact us on WhatsApp