I make a cat of a file and apply on it a grep with a regular expression like this
cat /tmp/tmp_file | grep "toto.titi\[[0-9]\+\].tata=55"
the command display the following output
toto.titi[12].tata=55
is it possible to modify my grep command in order to extract the number 12 as displayed output of the command?
greporsedto cut this info out.| cut -f2 -d'[' | cut -f1 -d']'but I want to know how to it with the same grepgrep.-P (PCRE)switch. I provided an answer below.