Validation for unicode alphanumeric characters?

  • Follow


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
0
Reply avnishmidha (2) 7/4/2003 7:43:41 PM


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/

0
Reply Martin 7/5/2003 9:59:57 AM


1 Replies
730 Views

(page loaded in 0.044 seconds)

Similiar Articles:






7/23/2012 8:48:14 PM


Reply: