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]*/guHow to use
- Select a curated Arabic pattern by the job it performs.
- Review its purpose and limitation before copying it into production.
- Edit the sample text to verify matches against your own Arabic or mixed-direction content.
- Copy either the pattern source or the complete JavaScript regex literal.
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.
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
Arabic Search Normalization
Normalize Arabic queries and indexed text with identical rules, then test exact, phrase, or token matching.
Arabic Text Normalizer
Standardize Arabic text — diacritics, letter variants, spacing and numerals.
Regex Tester
Test regular expressions against text with live match highlighting and capturing groups.
Arabic Developer Kit (RTL Snippets)
Copyable TypeScript functions, Next.js RTL layouts, and React BiDi isolation snippets.
Arabic Form Validation
Test inclusive or Arabic-only validation for names, phone numbers, and Arabic text with copyable JavaScript.