2

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

Dimitri Dewaele
  • 10,311
  • 21
  • 80
  • 127
Kashif Hanif
  • 1,718
  • 2
  • 17
  • 29

1 Answers1

1

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

Community
  • 1
  • 1
Harpreet Singh
  • 2,651
  • 21
  • 31
  • Thanks a lot @Harpreet Singh..Your idea worked perfect for me..I have successfully implement search in drop down after 2 hour work..Yahooooooooo no i can search Urdu or any other language.Thanks a lot again for help. – Kashif Hanif Jun 28 '14 at 22:40
  • @KashifR, Even I am feeling great for helping a Pakistani Brother on Stackoverflow. Thanks for accepting. – Harpreet Singh Jun 29 '14 at 02:42
  • Again Thanks Paa G @Harpreet Singh – Kashif Hanif Jun 29 '14 at 09:50