Quantcast
Channel: Visual Studio and Visual Web Developer Express
Viewing all articles
Browse latest Browse all 3509

Working with Regular Expressions

$
0
0

Hello,

I am working with the ASP RegularExpressionValidator control to verify that fields such as Name, City, State .. include only alphabetic characters. Simple enough, you'd think, however my attemps thus far have failed. I have tried both of the following with and without the preceeding dot.

ValidationExpression=".[\D]"

ValidationExpression=".[A-Za-z]"

Full Example:
<asp:RegularExpressionValidator ID="regExLast" runat="server" ErrorMessage="**Alphabetic Characters Only**" Font-Italic="true" ForeColor ="blue"
               ControlToValidate="last" ValidationExpression="[A-Za-z]" />

I am obviously very new to this; this is my first time working with regular expressions. The expressions used for the phone and zip fields I was able to retreive from my textbook.

If you have any words of advice, I'd appreciate it.


Viewing all articles
Browse latest Browse all 3509

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>