Finding the data between two different substrings in a string
Hey guys-
This is probably really easy for someone...I can't figure it out with CF. I've searched a bunch but haven't found exactly what I'm looking for.
I'm searching a HTML document with Coldfusion and need to pull some data from it. Just as a quick example, somewhere in the HTML document there might be some code that looks like (this is obviously super simplified):
<tr><td>Grand Total: </td></tr><tr><td>$1000.00</td> </tr>
I need to do a couple of things. 1) I need to capture the $1000.00 (this amount is dynamic, it will be different on every HTML doc) 2) I need to delete the whole row (or two rows in this example).
I'm guessing it's something along the lines of setting " <tr><td>Grand Total:</td></tr><tr><td> " to a variable, then searching for everything after until it finds </td> and storing that as a variable.... and then for step two storing everything from the <tr><td>Grand Total:</td></tr><tr><td> to the next </tr> as a variable, and then using Replace to take it out of the document. I just dont know how to do the "capture everything from 1 pre-established variable to the next time the code has variable number 2 (in this case, either </td> or </tr>) part.
Any thoughts or help would be so greatly appreciated!
Thanks all!!
JE
