RegularExpressionValidator and Int'l characters

Discussion in 'ASP .Net' started by Tomasz J, Nov 8, 2007.

  1. Tomasz J

    Tomasz J Guest

    Hello Developers,

    Is there any easy way of validating user input, like last name, using
    RegularExpressionValidator which would allow for international characters?

    Apprently ValidationExpression="^[\w\s']+$" is not the right way to do it.

    Thank you for any hints.

    Tomasz J
     
    Tomasz J, Nov 8, 2007
    #1
    1. Advertising

  2. Hello, Tomasz

    Apparently your RegEx expression is a bit weird. For what I can gather
    you want to accept letters, space and a single quote char ('). Am I
    right?

    So I think that a RexEx expression like "^((\w|')+\s+?)$" (without the
    outer quotes) should do the trick.

    However the validation needs to be done on the server (and making sure
    that the Cuture of the page is set) because the JavaScript does not
    handle internationalization very well.

    Regards,

    Paulo Santos
    http://pjondevelopment.50webs.com

    On Nov 8, 7:12 pm, "Tomasz J" <> wrote:
    > Hello Developers,
    >
    > Is there any easy way of validating user input, like last name, using
    > RegularExpressionValidator which would allow for international characters?
    >
    > Apprently ValidationExpression="^[\w\s']+$" is not the right way to do it.
    >
    > Thank you for any hints.
    >
    > Tomasz J
     
    PJ on Development, Nov 8, 2007
    #2
    1. Advertising

  3. Tomasz J

    Tomasz J Guest

    I am not sure why you said my expression is weird - it looks fine to me.
    But it is a very good point! I probably should set
    EnableClientScript="false".

    Thank you.

    Tomasz
     
    Tomasz J, Nov 9, 2007
    #3
    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. Schnoffos
    Replies:
    2
    Views:
    1,251
    Martien Verbruggen
    Jun 27, 2003
  2. Hal Styli
    Replies:
    14
    Views:
    1,709
    Old Wolf
    Jan 20, 2004
  3. Nathan Sokalski
    Replies:
    9
    Views:
    514
    Nathan Sokalski
    Jan 8, 2007
  4. arun
    Replies:
    8
    Views:
    481
    Dave Thompson
    Jul 31, 2006
  5. Matt Morris

    RegularExpressionValidator and Greek Characters

    Matt Morris, Feb 14, 2005, in forum: ASP .Net Web Controls
    Replies:
    0
    Views:
    149
    Matt Morris
    Feb 14, 2005
Loading...

Share This Page