开发者

regex is not working as expected

i am using this regex exp /[^\p{L}\s-]/ to capture strange characters.

The pro开发者_JAVA百科blem is that regex match this words for example:

Santarém (city name)
or 
Constançia (city name)

so i need to block symbols like "#$#%/*&/! but no the ´` Ç or ^~ -

thanks


I do not know how the city names are stored, but the marks could be stored as separate unicode elements, in which case you need to include the \p{M} set in your regex (as per http://www.regular-expressions.info/unicode.html#prop)


this solve my problem

thanks

[^A-Za-z0-9-áàçéâãôó]|(\d+)
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜