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.
Use /^[\s\p{L}]+$/u
(PHP syntax).
Edit: Adjusted regex to better handle whitespace.
/u
at the end means ?
Commented
May 27, 2020 at 11:25
\p{L} catches not only Polish letters, but also Russian for example, may be some other too.
If you, like me, need Polish letters only, take this:
[AaĄąBbCcĆćDdEeĘęFfGgHhIiJjKkLlŁłMmNnŃńOoÓóPpRrSsŚśTtUuWwYyZzŹźŻż]
Characters got from wiki
I used:
[UserName=[A-Za-zżźćńółęąśŻŹĆĄŚĘŁÓŃ]* [A-Za-zżźćńółęąśŻŹĆĄŚĘŁÓŃ]*\]
for both firstname and surname.
/^[a-zA-Z \\p{L}\+u]+$/
but it is not working and so am stuck at this. any suggestions.
sed
or Notepad++?