正则表达式与印度字符

时间:2013-02-13 18:00:15

标签: javascript regex character hindi

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

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}

但是如果我搜索此文本(在OpenOffice中):http://pastebin.com/mDHL69XH,请执行以下操作:\ x {0600} - \ x {06ff} 没有找到......

1 个答案:

答案 0 :(得分:10)

这应该做

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

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

\p{Devanagari}//not widely supported