decrypt Posted August 31, 2005 Posted August 31, 2005 (edited) I'm getting information out of an html document. Here is the html: Text here <STRONG>Info:</STRONG> <b>Information</b> here.<BR><STRONG>hello</STRONG><BR> ... Text here <STRONG>Info:</STRONG> <b>blahblah</b><BR><A HREF="blah.html">MORE</STRONG><BR> ... Text <STRONG>Info:</STRONG> more <b>stuff</b><BR>HELLO<BR> ... Text <STRONG>Info:</STRONG> more<b>stuff</b><BR><IMG SRC="image.jpg"><BR> I want to be able to find just the "<STRONG>Info:</STRONG> Information changes in <b>here.</b><BR>" and nothing else on the line. I've tried different things like the following: (<STRONG>Info:</STRONG>)(?!<BR>).+<BR> It will then get: <STRONG>Info:</STRONG> Information <b>here.</b><BR><STRONG>hello</STRONG><BR> instead of <STRONG>Info:</STRONG> Information <b>here.</b><BR> (which is what i want) Thanks in Advance, decrypt Edited August 31, 2005 by decrypt Quote
IngisKahn Posted August 31, 2005 Posted August 31, 2005 Drop the lookahead and use a "few as possible" match. e.g. .+? <STRONG>Info:</STRONG>.+?<BR> Quote "Who is John Galt?"
decrypt Posted September 1, 2005 Author Posted September 1, 2005 wow, thanks a lot. That worked perfectly :) Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.