I want to extract name of removed packages from here "cat /var/log/dpkg.log | grep 'remove'"
2013-09-09 15:57:34 remove activity-log-manager:i386 0.9.4-0ubuntu6.2 <none>
2013-09-09 15:57:35 remove activity-log-manager-control-center:i386 0.9.4-0ubuntu6.2 <none>
2013-09-09 15:57:38 remove alacarte:all 3.6.1-0ubuntu3 <none>
2013-09-09 15:57:41 remove deepin-software-center:all 2.1.2.1~precise~NoobsLab.com <none>
I want to grab only name of the packages between remove and colon after package name.
I am not a regex expert, I made a regex expression that seems to do the job but when I want to apply it with grep nothing happens.
Here is working regex pattern in regex evaluators
(?<=remove)(.*?)(?=:)
But this is not working :
cat /var/log/dpkg.log | grep 'remove' | grep '(?<=remove)(.*?)(?=:)'
What am I missing here?