001、
[root@PC1 test3]# echo "Hello, my name is aming."|grep -P '(?<=Hello, ).*(?= aming.)' Hello, my name is aming.
002、
[root@PC1 test3]# ifconfig | grep -P '(?<=inet).*(?=netmask)' inet 192.168.184.128 netmask 255.255.255.0 broadcast 192.168.184.255 inet 127.0.0.1 netmask 255.0.0.0 inet 192.168.122.1 netmask 255.255.255.0 broadcast 192.168.122.255
。
ref:
01:https://blog.51cto.com/u_15127506/4147133
标签:test3,grep,PC1,perl,Linux,root From: https://www.cnblogs.com/liujiaxin2018/p/18263456