Validation for unicode alphanumeric characters?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Avnish

    Validation for unicode alphanumeric characters?

    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
  • Martin Honnen

    #2
    Re: Validation for unicode alphanumeric characters?



    Avnish wrote:[color=blue]
    > 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.[/color]

    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


    Comment

    Working...