Advertisement
Guest User

Atomic Group

a guest
Nov 14th, 2021
199
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.77 KB | None | 0 0
  1. C:\msys64\usr\bin>cat animals.txt
  2. the big dog
  3. the small bird
  4. the biggest dog
  5. the small cat
  6.  
  7. C:\msys64\usr\bin>grep -P --color "(?>big|biggest)" animals.txt
  8. the big dog
  9. the biggest dog
  10.  
  11. C:\msys64\usr\bin>grep -P --color "(?>biggest|big)" animals.txt
  12. the big dog
  13. the biggest dog
  14.  
  15. C:\msys64\usr\bin>cat abc.txt
  16. abc
  17. abcc
  18.  
  19. C:\msys64\usr\bin>grep -P --color "a(?>b|bc)c" abc.txt
  20. abc
  21. abcc
  22.  
  23. C:\msys64\usr\bin>grep -P --color "a(?>bc|b)c" abc.txt
  24. abcc
  25.  
  26. C:\msys64\usr\bin>cat num.txt
  27. Dat foo 13.45 and $600 bar {baz:70} and {8}
  28.  
  29. C:\msys64\usr\bin>grep -P --color "(?<!{)([0-9]+(\.[0-9]+)?)(?!})" num.txt
  30. Dat foo 13.45 and $600 bar {baz:70} and {8}
  31.  
  32. C:\msys64\usr\bin>grep -P --color "(?<!{)(?>[0-9]+(\.[0-9]+)?)(?!})" num.txt
  33. Dat foo 13.45 and $600 bar {baz:70} and {8}
  34.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement