Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to deal with Polish Characters while using regex?

Tags:

regex

php

unicode

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.

like image 962
Rachel Avatar asked Jun 10 '10 14:06

Rachel


1 Answers

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

Edit: Adjusted regex to better handle whitespace.

like image 182
Brock Adams Avatar answered Oct 19 '22 02:10

Brock Adams