If you'd want to commit a cardinal sin you could try something like:
perl -0777 -ne 'print "$1\n" while(/<b>((.|\n|\r|)*?)<\/b>/gm);' test.
+html
- the -0777 will slurp the file at once
- the (.|\n|\r|)*?)will match any character including line-ending characters, and match them non-greedy.
- the //gm regex modifiers will match multiple lines and match as much times as possible.
But for more than a quick hack I'd go with the solutions already offered.
Update: to address seattlejohn's
<b name=value> problem you could use:
perl -0777 -ne 'print "$1\n" while(/<b\b.*?>((.|\n|\r|)*?)<\/b>/gm);'
+test.html
I think there will be lots of other situations where this oneliner won't match, and thats exactly the point why you should use a descent parser.