2 ms·
I often use `\K` instead, which also helps if it is variable length lookbehind $ echo 'foo=5, Bar=3; x1=83, y=120' | grep -oP '\b[a-z]+=\K\d+' 5 12
by asicsp 9y ago
I often use `\K` instead, which also helps if it is variable length lookbehind
$ echo 'foo=5, Bar=3; x1=83, y=120' | grep -oP '\b[a-z]+=\K\d+'
5
120
further reading: https://stackoverflow.com/questions/11640447/variable-length-lookbehind-assertion-alternatives-for-regular-expressions/11640500#11640500 https://stackoverflow.com/questions/11640447/variable-length...