tags:

views:

93

answers:

2

I have street name as KRZYWOŃ ANIELI and so what should be my regex to allow this kind of expression. Currently I have simple one which uses /^[a-zA-Z ]+$/

Kindly advise.

A: 

Use unicode. see here unicode regular expressions

PurplePilot
I have gone through it but am newbie and so would really appreciate if you guide with the regex expression.
Rachel
I will try but i am busy at the moment, so if no one else dives in later on this evening.
PurplePilot
You probably want to replace your character class with the unicode class \p{L} or \p{Letter}: any kind of letter from any language.
dsolimano
@dsolimani - how can this be done. I have tried using `/^[a-zA-Z \\p{L}\+u]+$/` but it is not working and so am stuck at this. any suggestions.
Rachel
@purlplepilot - thank you for your inputs.
Rachel
+1  A: 

Use /^[\s\p{L}]+$/u (PHP syntax).

Edit: Adjusted regex to better handle whitespace.

Brock Adams
`\p{L}` does already contain `a-z` and `A-Z`.
Gumbo
@Gumbo, yes, of course. I was trying to tune the regex to what the OP seemed to expect.
Brock Adams