I know it's possible to match a word and then reverse the matches using other tools (eg grep -v
). 我知道能够匹配一个单词,而后使用其余工具(例如grep -v
)反转匹配。 However, is it possible to match lines that do not contain a specific word, eg hede
, using a regular expression? 可是,是否可使用正则表达式匹配不包含特定单词(例如hede
)的行? 正则表达式
hoho hihi haha hede
grep "<Regex for 'doesn't contain hede'>" input
hoho hihi haha