in reply to Help with getting everything from X until Y
>Problem is, the data isn't on the same line, so a regular >expression won't help me.
I just want to check that we're not missing something fundamental here -- this sentence definitely implies that the original poster believes regexes are unable to match patters which cross a linebreak.
In case that truly was his or her belief -- they can. Specifically, the dot character in regexes matches everything except a linebreak, unless the /s modifier is used.
So to match this:
you can just use<b>Title: </b> STRING_I_WANT<br>
right?m#<b>Title:.*?</b>(.*?)<br>#s;
Every bit of code is either naturally related to the problem at hand, or else it's an accidental side effect of the fact that you happened to solve the problem using a digital computer.
M-J D
|
|---|