Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- C:\msys64\usr\bin>cat animals.txt
- the big dog
- the small bird
- the biggest dog
- the small cat
- C:\msys64\usr\bin>grep -P --color "(?>big|biggest)" animals.txt
- the big dog
- the biggest dog
- C:\msys64\usr\bin>grep -P --color "(?>biggest|big)" animals.txt
- the big dog
- the biggest dog
- C:\msys64\usr\bin>cat abc.txt
- abc
- abcc
- C:\msys64\usr\bin>grep -P --color "a(?>b|bc)c" abc.txt
- abc
- abcc
- C:\msys64\usr\bin>grep -P --color "a(?>bc|b)c" abc.txt
- abcc
- C:\msys64\usr\bin>cat num.txt
- Dat foo 13.45 and $600 bar {baz:70} and {8}
- C:\msys64\usr\bin>grep -P --color "(?<!{)([0-9]+(\.[0-9]+)?)(?!})" num.txt
- Dat foo 13.45 and $600 bar {baz:70} and {8}
- C:\msys64\usr\bin>grep -P --color "(?<!{)(?>[0-9]+(\.[0-9]+)?)(?!})" num.txt
- Dat foo 13.45 and $600 bar {baz:70} and {8}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement