sed cmd I want to print all occurrences of a pattern in one line.
I know how to do this with
grep -Pe and with
awk. I started with:
$ sed 's/^.*label="\(.*\)" selected.*$/\1/g' <(echo 'smkj sld/6_ !label="snd 1" selected>lms slks.;label="snd 2" selected>lkwnl wlkmlabel="snd 3" selected>The following should not be printedlabel="') snd 3
However the above only prints
snd 3, i.e. the string between the last occurrence of
" selected. How do I include all occurrences of the regex on any one line ?