带有印度字符的正则表达式 [英] Regular expressions with Indian characters

查看:483
本文介绍了带有印度字符的正则表达式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道是否可以为印度字符编写正则表达式?我想验证给定的字符是否是印度字母或数字。我发现这两个问题:

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

所以我试过这个:\x {0600} -\x {06ff}

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

但如果我在OpenOffice中搜索此文本( http://pastebin.com/mDHL69XH ) :\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...

推荐答案

这应该是

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

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

\p{Devanagari}//not widely supported

这篇关于带有印度字符的正则表达式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆