Struts - validating foreign characters

Discussion in 'Java' started by mdjj, Mar 31, 2006.

  1. mdjj

    mdjj Guest

    I need to validate my web app to allow both english and european
    characters (anything else I'll reject). I can do it by allowing
    individual characters in the mask i.e.

    >From validation.xml :


    <constant>
    <constant-name>alphaForeignCheck</constant-name>
    <constant-value>^[a-zA-Z è\s]*$</constant-value>
    </constant>

    This will allow for alphas and è. But rather than list individual
    foreign characters is there a way to group say all french all german
    characters?
    mdjj, Mar 31, 2006
    #1
    1. Advertising

  2. mdjj

    Oliver Wong Guest

    "mdjj" <> wrote in message
    news:...
    > I need to validate my web app to allow both english and european
    > characters (anything else I'll reject). I can do it by allowing
    > individual characters in the mask i.e.
    >
    > >From validation.xml :

    >
    > <constant>
    > <constant-name>alphaForeignCheck</constant-name>
    > <constant-value>^[a-zA-Z è\s]*$</constant-value>
    > </constant>
    >
    > This will allow for alphas and è. But rather than list individual
    > foreign characters is there a way to group say all french all german
    > characters?


    Unicode code charts are at: http://www.unicode.org/charts/

    You'll probably want \u00c0 to \u00FF, except not \u00f7 and \u00d7. You
    might want to also look at Latin Extended A and Latin Extended B.

    Perhaps you can save yourself a lot of effort and do the validation in Java,
    via Character.isLetter()

    - Oliver
    Oliver Wong, Mar 31, 2006
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    0
    Views:
    374
  2. Replies:
    1
    Views:
    507
    Joerg Jooss
    Aug 22, 2005
  3. rachel cox
    Replies:
    1
    Views:
    2,949
    BarryNL
    Feb 3, 2004
  4. WEB 1040
    Replies:
    2
    Views:
    397
    Smike
    Apr 6, 2005
  5. H5N1
    Replies:
    0
    Views:
    428
Loading...

Share This Page