RegularExpressionValidator and Int'l characters

  • Thread starter Thread starter Tomasz J
  • Start date Start date
T

Tomasz J

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
 
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
 
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
 
Back
Top