Regular expressions with Indian characters

扶醉桌前 提交于 2019-12-04 14:37:37

问题


I wonder is it possible to write a regular expression for indian characters? I want to validate if the given character is an Indian letter or number. I found this two questions:

What are the unicode ranges for Hindi accented characters?

what is the range for Hindu–Arabic (ARABIC-INDIC) numeral utf8 from 0 to 9

so I tried this: \x{0600}-\x{06ff}

But if I search this text (in OpenOffice): http://pastebin.com/mDHL69XH with this: \x{0600}-\x{06ff} nothing is found...


回答1:


Well this should do

[\u0900-\u097F]+// \uFFFF format supported by Java,.net

or

[\u{0900}-\u{097F}]+// \u{FFFF} format supported by perl,pcre

or

\p{Devanagari}//not widely supported


来源:https://stackoverflow.com/questions/14859957/regular-expressions-with-indian-characters

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!