I want to exclude some unwanted words in an input field of textarea using the pattern function in HTML5.
so I want exclude word inside a text like 'viagra' and 'cialis'
How can I code this?
You can use this regex :
^((?!viagra)(?!cialis).)*$
As explained in the post : Regular expression to match a line that doesn't contain a word?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With