Reputation: 79
I have an input tag within my python code the looks like this:
<input class="form-control input-lg" type="text" name="name" value="value" placeholder="placeholder" required pattern="^[a-zA-Z0-9.@#$()+! \'_-]+$">
I was able to escape the single quote ' in the required pattern ' but anytime I try to add a double quote ", then it closes the previous double quote (pattern="). I am looking to achieve something like:
pattern="^[a-zA-Z0-9.@#$()+! \'\"_-]+$">
where the \" should allow me to escape the quote but clearly that doesn't work like the \' works. Any help would be greatly appreciated.
Upvotes: 3
Views: 249
Reputation: 774
You can use r
in front of your pattern:
pattern = r"^[a-zA-Z0-9.@#$()+! \'\"_-]+$"
Upvotes: 0