Issue
I've this command grep -oP '.*?(?=\:)'
which gets words before : character, the thing I want is to get all the words after : character
How can I do it?
Solution
You can use \K
, which tells the engine to pretend that the match attempt started at this position. You can have something like:
grep -oP '.*:\K(.*)'
Example:
$ echo "hello:world" | grep -oP ":\K.*"
world
Answered By - Maroun Answer Checked By - Katrina (WPSolving Volunteer)