亚洲av成人无遮挡网站在线观看,少妇性bbb搡bbb爽爽爽,亚洲av日韩精品久久久久久,兔费看少妇性l交大片免费,无码少妇一区二区三区

Chinaunix

標(biāo)題: grep匹配問題 [打印本頁]

作者: askandstudy    時(shí)間: 2012-03-03 18:49
標(biāo)題: grep匹配問題
  1. [user1@RHEL6A temp]$ grep -E '10{3}' services
  2. cadlock2        1000/tcp                #
  3. cadlock2        1000/udp                #
  4. ndmp            10000/tcp               # Network Data Management Protocol
  5. ndmp            10000/udp               # Network Data Management Protocol
  6. scp-config      10001/tcp               # SCP Configuration Port
  7. scp-config      10001/udp               # SCP Configuration Port
  8. documentum      10002/tcp               # EMC-Documentum Content Server Product
  9. documentum      10002/udp               # EMC-Documentum Content Server Product
  10. documentum_s    10003/tcp               # EMC-Documentum Content Server Product
  11. documentum_s    10003/udp               # EMC-Documentum Content Server Product
  12. emcrmirccd      10004/tcp               # EMC Replication Manager Client
  13. emcrmird        10005/tcp               # EMC Replication Manager Server
  14. mvs-capacity    10007/tcp               # MVS Capacity
  15. mvs-capacity    10007/udp               # MVS Capacity
  16. octopus         10008/tcp               # Octopus Multiplexer
  17. octopus         10008/udp               # Octopus Multiplexer
  18. swdtp-sv        10009/tcp               # Systemwalker Desktop Patrol
  19. swdtp-sv        10009/udp               # Systemwalker Desktop Patrol
  20. irisa           11000/tcp               # IRISA
  21. irisa           11000/udp               # IRISA
  22. irtrans         21000/tcp               # IRTrans Control
  23. irtrans         21000/udp               # IRTrans Control
復(fù)制代碼
比如上面這樣,我想只匹配出現(xiàn)3個(gè)0,而不要連續(xù)2個(gè)0或大于3個(gè)0的怎么寫的?
作者: mpstat    時(shí)間: 2012-03-03 18:58
grep -P '10{3}(?!=0)'
作者: askandstudy    時(shí)間: 2012-03-03 19:11
厲害,怎么正則表達(dá)式還分perl正則表達(dá)式的,還以為是統(tǒng)一的,還得再找點(diǎn)資料學(xué)習(xí)學(xué)習(xí),謝謝!
作者: ziyunfei    時(shí)間: 2012-03-03 19:12
'[^0]000[^0]'
作者: askandstudy    時(shí)間: 2012-03-03 19:24
樓上的也可以,謝謝

[user1@RHEL6A temp]$ grep -E '1000[^0]' services

作者: mpstat    時(shí)間: 2012-03-03 19:41
回復(fù) 4# ziyunfei


    這個(gè)如果是1000后面啥都沒有是不是匹配不了了

作者: zooyo    時(shí)間: 2012-03-03 21:02
提示: 作者被禁止或刪除 內(nèi)容自動屏蔽




歡迎光臨 Chinaunix (http://www.72891.cn/) Powered by Discuz! X3.2