Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to include double quote(") in regular expression

Does any one know how to include double quote in regular expression.I wrote this regex but unable to include the double quote

<asp:RegularExpressionValidator ID="KeywordsRegex" runat="server" 
 ValidationExpression="^[+\-\!\(\)\:\^\[\]\{\}\~\*\?\&&\||].*$" 
 ControlToValidate="Keywords" ErrorMessage="Search keyword is not valid." 
 Text="*"></asp:RegularExpressionValidator> 
like image 439
Asp.Net Dev Avatar asked Mar 21 '12 16:03

Asp.Net Dev


2 Answers

Try putting a backslash (\) followed by &quot;. That would be proper XML.

like image 85
Oscar Broman Avatar answered Sep 27 '22 21:09

Oscar Broman


have you tried escaping the double quote with a backslash?

like image 35
Peter Perháč Avatar answered Sep 27 '22 20:09

Peter Perháč