Using regular expressions in PHP, how can I make the user type Arabic, English, numbers, _, - or a space.
For example, a user may enter the following lines:
To check arabic characters you can use
\p{InArabic}
This page can help you on your journey.
, _ - ... [a-zA-Z0-9_-]* ( , , , )... (, , )... , ...
[a-zA-Z0-9_-]*
...;)
Greetz
back2dos
Try the following:
'/^([a-zA-Z0-9]|[\p{Arabic}]|[_])*$/u'
Source: https://habr.com/ru/post/1711870/More articles:Match Unicode control characters except three with regular expressions - regexAppleScript: how can I exit all running user applications and then restart the bootcamp section (this part works)? - applescriptbluetooth protocol implementation - bluetoothJquery dynamic id control property - jqueryShould ASP.NET MVC Developers Really Learn Ruby on Rails? - ruby-on-railsExceptions and Abstractions - language-agnosticObjective-C - Adding characters to specific parts of a string - objective-cWhy it does not compile in F # - recursionWhat is a good php class for SMTP email? - phpWrite a shell script that finds-greps and prints the file name and contents in 1 line - bashAll Articles