javascript - How to convert PHP regex to match Arabic characters to JS regex -


i have english , arabic regex in php , works fine php

but not working library formvalidation.io

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

i need make work , convert js regex use in formvalidation regex.

demo regex 101

the arabic regex is:

[\u0600-\u06ff] 

actually, ٠-٩ subset of arabic range, think can remove them pattern.

so, in js be

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

see regex demo


Comments

Popular posts from this blog

authentication - Mongodb revoke acccess to connect test database -

r - Update two sets of radiobuttons reactively - shiny -

ios - Realm over CoreData should I use NSFetchedResultController or a Dictionary? -