javascript - Regular expression to match text that "doesn't" contain a word? -


i exclude words using regular expression.

input text:

aaa1234 cc bbb1234 c1234 cc dd aacc cccc ccadf cc 

output text:

aaa1234 bbb1234 c1234 dd aacc cccc ccadf 

exclude word: cc

i used (^|\s)[^(cc)]+(\s|$)

how make regular expression work?

\s+\bcc\b|\bcc\b\s+ 

try this.replace empty string.see demo.

https://regex101.com/r/ck4iv0/25


Comments

Popular posts from this blog

toolbar - How to add link to user registration inside toobar in admin joomla 3 custom component -

linux - disk space limitation when creating war file -