I have a problem with an regular expression which allow me to put a name lets say if an institution which can contain special characters for other languages, white space and – char.
I know that expression i created:
/^[a-zA-Z- "\']*$/
will allow chars from a to z and -‘” chars and white space. But when i type żźćąś or other languages special chars string is not valid, but i want it to be valid.
Second expression which i created:
/^[^\~\\!\\@\\#\\$\\%\\^\\&\\*\\(\\)\\`\\1\\2\\3\\4\\5\\6\\7\\8\\9\\0\\_\\+\\=\\{\\}\\:\\"\\;\\\\\<\\>\\?\\,\\.\\/\ ]*$/
allows a-z characters without characters disallowed above. But I dont disallow white space in regex above but when i type something with space like that for example:
"Bielsko Biała"
Its not valid, but when i type it together:
"BielskoBiała"
it is valid with ą character. So i’d like to allow special chars like żźćąśł and others from other languages but also like to allow white spaces and i dont knot how to do it.
When i was using Alpha validator it was ok but dont allow to put -‘” chars which i also want to allow.
First you have to enable UTF-8 support with the
uswitch. Then you can match unicode letters with the sequence\pL. See here.So your solution would be