如何在Jquery选择插件中搜索Urdu?还有其他方法可以在Selectbox中搜索urdu吗? [英] How to Search Urdu in Jquery Chosen Plugin?Is there another way to search urdu in Selectbox?

查看:132
本文介绍了如何在Jquery选择插件中搜索Urdu?还有其他方法可以在Selectbox中搜索urdu吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

基本上我希望在选择框中具有搜索选项,并且在选择框中实现了选择的jquery.所有选项都使用乌尔都语.如何扩展所选搜索以匹配乌尔都语?

还是在选择"框中搜索乌尔都语?

任何其他建议.预先感谢

解决方案

有一种非常简单的方法,可以将所有的RegEx逻辑(一个人可以很容易地用英语应用)应用到使用Unicode的任何语言.

要匹配所有字母[A-Za-z]之类的Unicode字符,我们可以使用

[\ u0041- \ u005A],其中 \ u0041 A 的十六进制代码,而 \ u005A 的十六进制代码Z

'matchCAPS leTTer'.match(/[\u0041-\u005A]+/g)
//output ["CAPS", "TT"]

以相同的方式,我们可以根据unicode.org提供的其他十六进制顺序(例如:\ u0A10到\ u0A1F)使用其他Unicode字符或等效的十六进制代码

尝试:

[ڀ-ڴ]

如果unicode.org按此顺序提供,它将匹配ڀ和between之间的所有字符

我不知道阿拉伯语/乌尔都语:)

要进行匹配::您可以轻松获取任何英语插件,并用Urdu/Arabic chars对其稍作修改即可.

供参考:

JavaScript regex不敏感土耳其字符问题

验证多语言-日语langauga的网址

使用jQuery和RegEx进行多语言电子邮件地址验证

Basically I want to have search option in select box with jquery chosen implemented on select box.All option are in Urdu Language.How can I expand chosen search to match Urdu?

Or there is another way to search Urdu in Select box?

any Other suggestion.Thanks in Advance

解决方案

There is a very simple method to apply all you RegEx logic(that one can apply easily in English) for any Language using Unicode.

For matching a range of Unicode Characters like all Alphabets [A-Za-z] we can use

[\u0041-\u005A] where \u0041 is Hex-Code for A and \u005A is Hex Code for Z

'matchCAPS leTTer'.match(/[\u0041-\u005A]+/g)
//output ["CAPS", "TT"]

In the same way we can use other Unicode characters or their equivalent Hex-Code according to their Hexadecimal Order (eg: \u0A10 to \u0A1F) provided by unicode.org

Try:

[ڀ-ڴ]

It will match all characters between ڀ and ڴ if provided by unicode.org in this order

I don't know Arabic/Urdu :)

For matching: you can easily get any plugin for English, modify it little bit with Urdu/Arabic chars and its done.

For Ref:

Javascript regex insensitive turkish character issue

Validate url for multilingual - Japanese langauga

Multilingual email address validation with jQuery and RegEx

这篇关于如何在Jquery选择插件中搜索Urdu?还有其他方法可以在Selectbox中搜索urdu吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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