How to include double quotation mark (") in regular expression

Does anyone know how to include a double quote in a regex. I wrote this regex but could not include the double quote

<asp:RegularExpressionValidator ID="KeywordsRegex" runat="server" ValidationExpression="^[+\-\!\(\)\:\^\[\]\{\}\~\*\?\&&\||].*$" ControlToValidate="Keywords" ErrorMessage="Search keyword is not valid." Text="*"></asp:RegularExpressionValidator> 
+6
source share
4 answers

Try putting a backslash ( \ ) and then &quot; . This will be the correct XML.

+10
source

Have you tried to avoid double backslash quotes?

+1
source

you may need to double the escape, for example \\\"

0
source

Try to avoid this: Replace each "with"

0
source

Source: https://habr.com/ru/post/911322/


All Articles