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