Ok so I am rusty as hell with regular expressions. So far I have been able to eek by with some horrid amalgamations of expressions to get the right stuff parsed out, but now I seem to be stuck.
basically I want to search through an html document for
<td class="foo">bar</td>
Where foo can be any classname and bar can be mixed html content (contain other tables, etc). Right now this is my completely non-working expression:
"/<td.*class=\"([^\"]*)\">([^<\/td]*)/"
Now I know from previous expressions that the class=\"([^\"]*)\" works fine, but how can I tell it to find the proper </td> assuming there can be </td> tags in the intermediate content I want to capture?
My current guess is I am going to have to write a custom string parser to be sure that it can handle internal tables, but I was hoping there may be some magical regex to save me from this and keep my code nice and tidy.
Any help is appreciated
basically I want to search through an html document for
<td class="foo">bar</td>
Where foo can be any classname and bar can be mixed html content (contain other tables, etc). Right now this is my completely non-working expression:
"/<td.*class=\"([^\"]*)\">([^<\/td]*)/"
Now I know from previous expressions that the class=\"([^\"]*)\" works fine, but how can I tell it to find the proper </td> assuming there can be </td> tags in the intermediate content I want to capture?
My current guess is I am going to have to write a custom string parser to be sure that it can handle internal tables, but I was hoping there may be some magical regex to save me from this and keep my code nice and tidy.
Any help is appreciated