fetch substring from html code

hello mates.
please help me out once again.
i have a html file where i want to fetch out one value from the entire html-code

sample html code:

.....
 <b>Amount:<b> 12345</div>
...

now i only want to fetch the 12345 from the html document.

how to i tell sed to get me the value from between <b>Amount<b> and </div>

thanks guys

I guess you probably know that isn't even valid HTML. Presuming you have a vaild </b> end tag in reality, try this;

sed -n 's%<b>Amount:</b>\([^<>]*\)</div>%\1%p' file.html

If you really do have a HTML syntax error there, take out the slash in the </b> tag.

This finds a line matching the pattern, replaces it with just the part between the \( parentheses \) and prints it. If there are multiple such lines, they will all be printed.

thanks man, the <b> was a typo.
nice you care so much.