Hello,
New to regex and my head is spinning more than the girl in the "Exorcist".
I'm trying to delete a bunch of html code. For example, this seems to work for deleting all the stuff between the first beginning and ending center tags:
After those center tags, there are other center tags further down the html page, with a bunch of other code and text in between, all of which I'd like to delete. So any ideas how to remove everything between the first <center> tag and say maybe the third </center> tag?
In the same vein, is there a simple regex for removing everything in a html page between the first instance of a beginning string and the first instance of another string regardless of the amount of text, lines or code between?
That is, say the first and last strings are:
which is the first string, and there is a whole bunch of code and text ending with the last string of:
</form>
I've tried more regex expressions than I can remember, and none work (or produce unexpected results), although it's certainly a learning experience.
Any help would be appreciated.
Thanks,
ronzo
New to regex and my head is spinning more than the girl in the "Exorcist".
I'm trying to delete a bunch of html code. For example, this seems to work for deleting all the stuff between the first beginning and ending center tags:
Code:
remove_center=s/\<center>(.*?)\</center>//g;After those center tags, there are other center tags further down the html page, with a bunch of other code and text in between, all of which I'd like to delete. So any ideas how to remove everything between the first <center> tag and say maybe the third </center> tag?
In the same vein, is there a simple regex for removing everything in a html page between the first instance of a beginning string and the first instance of another string regardless of the amount of text, lines or code between?
That is, say the first and last strings are:
Code:
<form method="post" action="something.cgi" blah blah blah> which is the first string, and there is a whole bunch of code and text ending with the last string of:
</form>
I've tried more regex expressions than I can remember, and none work (or produce unexpected results), although it's certainly a learning experience.
Any help would be appreciated.
Thanks,
ronzo