排除列表中指定的字,我有以下单词列表:POSIX正则表达式:使用正则表达式
www.home.example.com
www.example.com
home.example.com
google.com
example.com
child.example.com
sameer.example.com
sameer.google.com
我需要只匹配child domains of example.com
,这意味着我需要回答以下正则表达式:
www.home.example.com
home.example.com
child.example.com
sameer.example.com
但是没有使用egrep -v
选项。
我试过egrep -i '(([(a-zA-Z0-9\-\.|^www)]*)\.example\.com)'
但没有工作。任何帮助将不胜感激。
尝试'grep -v'^ red $''。 –
@WiktorStribiżew,看起来像是在工作,将其作为答案,以便我可以upvote你的答案。 – manjesh23
@WiktorStribiżew,但有没有办法可以跳过使用-v?因为不确定我的设备是否支持-v或不支持。我可以使用类似'!' – manjesh23