HTML5模式排除单词 [英] HTML5 pattern exclude words
本文介绍了HTML5模式排除单词的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想使用HTML5中的模式函数在textarea的输入字段中排除一些不需要的单词。
I want to exclude some unwanted words in an input field of textarea using the pattern function in HTML5.
所以我想要在'viagra'这样的文本中排除单词和'cialis'
so I want exclude word inside a text like 'viagra' and 'cialis'
我该怎么编码?
推荐答案
你可以使用这个正则表达式:
You can use this regex :
^((?!viagra)(?!cialis).)*$
如帖子所述:正则表达式匹配不包含单词的行?
这篇关于HTML5模式排除单词的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文