By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,294 Members | 2,517 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,294 IT Pros & Developers. It's quick & easy.

Validation for unicode alphanumeric characters?

P: n/a
Hi,

I am looking for some form of validation for all the alphanumeric
characters in the entire unicode range e.g. the validation should also
accept japanese characters but should restrict japanese punctuation
marks. I need this validation for atleast for the CJKT range if not
possible for the entire unicode range. I can even make use of regular
expressions.

Also, please note that this validation should be in Javascript
language.

Thanks in anticipation.

Regards,
Avnish
Jul 20 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a


Avnish wrote:
Hi,

I am looking for some form of validation for all the alphanumeric
characters in the entire unicode range e.g. the validation should also
accept japanese characters but should restrict japanese punctuation
marks. I need this validation for atleast for the CJKT range if not
possible for the entire unicode range. I can even make use of regular
expressions.

Also, please note that this validation should be in Javascript
language.


JavaScript 1.5's regular expression language doesn't define meta
characters for all alphanumeric unicode characters, nor does it define
meta characters for Japanese characters I think.
You can however specify Unicode ranges by hex code as in

var pattern = /[\u0061-\u007a]/;

which matches a-z.Thus the solution is to look up the Unicode character
code for the ranges you want to test for and put them into square brackets.

--

Martin Honnen
http://JavaScript.FAQTs.com/

Jul 20 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.