RegularExpression for Alphanumeric and Special Characters in ASP.Net

RichardSa
 
on Nov 30, 2022 04:16 AM
799 Views

I have this regukar expression validator but without special characters. please how can I have special chratcters too? 

 <asp:RegularExpressionValidator ID="Regex3" runat="server" Font-Size="8pt" ErrorMessage="Minimum of 8 characters [UpperCase, LowerCase and Number]" Font-Bold="true" ValidationExpression="^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)[a-zA-Z\d]{8,}$" ControlToValidate="pass" ForeColor="Red"></asp:RegularExpressionValidator>

 

Download FREE API for Word, Excel and PDF in ASP.Net: Download
RichardSa
 
on Nov 30, 2022 04:21 AM

I got the answer: 

this is how it is

ValidationExpression="(?=^.{6,10}$)(?=.*\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[!@#$%^&amp;*()_+}{&quot;:;'?/&gt;.&lt;,])(?!.*\s).*$"