I have a line like this
BR_MALLOC %p File - %s, Func - %s, Line - %u\n
This is actually a line from a C program which outputs the malloced address, the file where the custom malloc BR_MALLOC
was called etc etc.
Now, I am running sed
on this output to get just the malloced address (%p)
I tried this regular expression
$ echo "BR_MALLOC %p File - %s, Func - %s, Line - %u\n" | sed 's/BR_MALLOC\s+\(\S+\).*/\1'
Expected Output
%p
Output I get is
BR_MALLOC %p File - %s, Func - %s, Line - %un
Where am I going wrong?