Skip to content
Advertisement

How to deal with Polish Characters while using regex?

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.

Advertisement

Answer

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

Edit: Adjusted regex to better handle whitespace.

User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement