Validation for unicode alphanumeric characters?

A

Avnish

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
 
M

Martin Honnen

Avnish said:
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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top