I know another question that is very similar, but for some reason I'm still having problems.
I have a GC log that I am trying to crop in the Tenured section enclosed in [] .
63.544: [GC 63.544: [DefNew: 575K->63K(576K), 0.0017902 secs]63.546: [Tenured: 1416K->1065K(1536K), 0.0492621 secs] 1922K->1065K(2112K), 0.0513331 secs]
I am applying s/\[Tenured:.*\]//
And as expected, the result is greedily clipped to the rest of the line:
63.544: [GC 63.544: [DefNew: 575K->63K(576K), 0.0017902 secs]63.546:
So, let's try and be greedy not to match the closing right bracket with s/\[Tenured:[^\]]*\]// , but, alas, no match will be made, and sed will skip the line, creating the same original output:
63.544: [GC 63.544: [DefNew: 575K->63K(576K), 0.0017902 secs]63.546: [Tenured: 1416K->1065K(1536K), 0.0492621 secs] 1922K->1065K(2112K), 0.0513331 secs]
How am I not greedily matching and replacing this section? Thanks,
source share