Moayyad Faris
Arabic Developer Tools

Processed locally in your browser — not uploaded

Arabic Regex Patterns

Use a curated library of JavaScript regular expressions for common Arabic text jobs. Test patterns for Arabic words, Arabic-only input, Unicode-block characters, diacritics, Tatweel, Arabic-Indic and Persian digits, and Latin tokens inside mixed text—all locally in your browser.

Arabic Words

Find common Arabic-letter words while keeping attached diacritics.

/[\u0621-\u063A\u0641-\u064A][\u0621-\u063A\u0641-\u064A\u064B-\u065F\u0670]*/gu
Limit: Targets the core Arabic alphabet, not every extended Arabic-script letter.
3 matches
مرحباً بكم في Arabic Web ٢٠٢٦
01

How to use

  1. Select a curated Arabic pattern by the job it performs.
  2. Review its purpose and limitation before copying it into production.
  3. Edit the sample text to verify matches against your own Arabic or mixed-direction content.
  4. Copy either the pattern source or the complete JavaScript regex literal.
02

Understanding the output

Matches use the browser's native JavaScript RegExp engine. The highlighted text and match count therefore behave the same way as the copied pattern in modern JavaScript.

03

Common issues & tips

  • The Arabic Unicode block includes digits, punctuation, and symbols. Do not use a block range as proof that a string contains letters only.
  • Arabic-script languages use additional letters outside the core Arabic alphabet. Choose Unicode ranges for the languages your product supports.
  • Regex is useful for shape checks and extraction, but strict name validation often rejects legitimate people.

Frequently asked questions

Which regex should I use to detect Arabic text?
Use a pattern based on your actual requirement. The Arabic Unicode block finds letters, digits, punctuation, and symbols, while the Arabic Words pattern targets common Arabic letters and attached marks.
Can I validate Arabic names with one regex?
A strict letters-only regex often rejects legitimate names containing spaces, hyphens, apostrophes, or letters from other languages. Use permissive validation and verify only the constraints your product truly needs.
Do the patterns work in JavaScript?
Yes. Every pattern is tested with the browser's native JavaScript RegExp engine and includes the required flags.
Is my test text uploaded?
No. Pattern testing runs entirely in your browser.

Related tools