Regular match with arabic character and numbers

return preg_match('/^(\d*\p{Arabic}+*)$/iu', $str); 

I use the function above to match a string, for example: - "someordinArabic" - "3somewordinArabic", etc.

But I want it to match as well: - "3somewordin444Arabic" - "somethingarabic22"

So basically mixed Arabic with numbers, with the expression that at least one letter is in Arabic,

Can someone help me?

+4
source share
1 answer
 /^[\d\p{Arabic}]*\p{Arabic}[\d\p{Arabic}]*$/ui 
+3
source

All Articles