regex - Search for any word EXCEPT specific ones? -
i'm trying replace words plurals. know there multiple plural stems doing basic 's'. can make # of word-ending cases. purposes right i'd do:
(\w+\b) but have ignore either:
- specific words
- words end in specific letter(s)
so instance if had ignore \w+dy\b (e.g. study) , ignore words title|body find word except *dy, title, body
assuming have lookahead support can use regex:
\b(?!(title|\w*?dy)\b)\w+\b body ends dy no need add in exception list.
Comments
Post a Comment