1

I'm looking for a regular expression that will disallow extended ASCII characters, inorder to apply it on a text box in an ASP.NET application. Please help!

4

1 回答 1

1

The following will only match a string that contains only ASCII characters

^[\x00-\x7F]+$

To disallow only the extended ASCII characters you could use

^[^\x80-\xFF]+$
于 2013-04-13T19:22:51.610 回答