RegEx on Javascript; Checking for instances of one of multiple strings

前端 未结 2 1615
独厮守ぢ
独厮守ぢ 2021-01-27 11:39

I have done a lot of server side form validation but until now, the only client side form validation I have done is to check for null/blank entries (e.g., if (value==\'\'||value

2条回答
  •  隐瞒了意图╮
    2021-01-27 12:26

    I think that maintaining you dictionary with vulgar words would be hard in near future, when you would like add more and more words.

    My proposal is to build up an dictionary and use dictionary lookup. John Resig wrote two good articles about this things: http://ejohn.org/blog/javascript-trie-performance-analysis/ and http://ejohn.org/blog/dictionary-lookups-in-javascript/

提交回复
热议问题