1

I have this English and Arabic regex in php , it works fine with php

But its not working with this library Formvalidation.io

~^[a-z0-9٠-٩\-+,()/'\s\p{Arabic}]{1,}$~iu

I need to make it work and convert into JS regex to use in formvalidation regex.

Demo Regex 101

Wiktor Stribiżew
  • 607,720
  • 39
  • 448
  • 563
Noman
  • 4,088
  • 1
  • 21
  • 36

1 Answers1

2

The Arabic regex is:

[\u0600-\u06FF]

Actually, ٠-٩ is a subset of this Arabic range, so I think you can remove them from the pattern.

So, in JS it will be

/^[a-z0-9+,()\/'\s\u0600-\u06FF-]+$/i

See regex demo

Community
  • 1
  • 1
Wiktor Stribiżew
  • 607,720
  • 39
  • 448
  • 563