I have a textfile called netlist.txt with the following contents:
M1 nmos1
M2 nmos2
P1 pmos1
M3 nmos3
M4 nmos4
P2 pmos2
I want to retrieve only the line which starts with a tab/space and matching all the "M" values that are indented, using regex.
In order to accomplish this I entered the following expression in bash:
egrep [:space:]*[M][0-9]+ netlist.txt
But it doesn't recognize the space. It retrieves all the lines regardless of having a space or not. Please give me some advice on this. Thanks, Pedro