Regular Expression (Regex) for Alphabets with special characters only

on Nov 10, 2014 03:31 AM


hwwllo can any one explain me how to set regular expression for textbox that allows a to z,A to Z, special characters(,    .  #) ie comma dot and hash

Download FREE API for Word, Excel and PDF in ASP.Net: Download
on Nov 10, 2014 03:36 AM
on Nov 11, 2014 02:04 AM

Please refer this HTML code.

This will allow you Alphabets, Special Charecters (, . #)

<u>1. Using Regular Expression Validator</u>
<hr />
<asp:TextBox ID="TextBox1" runat="server" />
<br />
<asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" ControlToValidate="TextBox1"
    ValidationExpression="[a-zA-Z.,#]*$" ErrorMessage="*Valid characters: Alphabets and Special Characters (.,#)." />
<br />
<asp:Button ID="Button1" Text="Validate" runat="server" />