Searching for a pattern?

I'm trying to write an application that will search through a HTML pages code, look for tags and pluck out some text to be further processed.

I've been doing this using Strings and the substring method, however this gives me problems when the text I'm looking through are on several lines.

Isn't there way to search for a pattern containing wildcards? For instance

{*}<td>{1st text item}</td>{*}style='border:0px;margin-top:3px{2nd text item}<a*>

[494 byte] By [MG.dka] at [2007-10-3 9:14:40]
# 1
Why not user an HTML parser instead of trying to do it by hand?
zadoka at 2007-7-15 4:27:12 > top of Java-index,Java Essentials,Java Programming...
# 2
The API has that?
MG.dka at 2007-7-15 4:27:12 > top of Java-index,Java Essentials,Java Programming...
# 3
> Why not user an HTML parser instead of trying to do it by hand?Right. Here's one: http://jtidy.sourceforge.net/
quittea at 2007-7-15 4:27:12 > top of Java-index,Java Essentials,Java Programming...
# 4
Alternatively use regular expressions to search through the HTML
dovvera at 2007-7-15 4:27:12 > top of Java-index,Java Essentials,Java Programming...