Code Comments
Programming Forum and web based access to our favorite programming groups.X-No-Archive: yes
I'm starting out in Regular Expressions and need help with something, how do
I say:
(This is just a banner ad and I want to search for the tag in any files:)
<!-- TAG BANNER START -->
anything between here as it can be a different banner code but the two tags
above are always present.
<!-- TAG BANNER END -->
Example, the banner code changes:
<!-- TAG BANNER START -->
<script language="javascript">
var uri = 'http://xxxx.xxxxxx.xxx/imp/js/848986/404265?' + new String
(Math.random()).substring (2, 11);
document.write('<sc'+'ript language="JavaScript" src="'+uri+'"
charset="ISO-8859-1"></sc'+'ript>');
</script>
<!-- TAG BANNER END -->
As a Reg. Exp ?
Post Follow-up to this message127.0.0.1 wrote: > I'm starting out in Regular Expressions and need help with something, how do > I say: > > <!-- TAG BANNER START --> > > anything between here as it can be a different banner code but the two tag s > above are always present. > > <!-- TAG BANNER END --> Assuming Perl-compatible regular expressions, personally I'd match on: /<!-- TAG BANNER START -->.*?<!-- TAG BANNER END -->/s -- Toby A Inkster BSc (Hons) ARCS Contact Me ~ http://tobyinkster.co.uk/contact
Post Follow-up to this message
Show a Printable Version
Email This Page to Someone!
Receive updates to this thread
Powered by vBulletin
Copyright 2000-2006 Jelsoft Enterprises Limited.