Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

Starting out inreg expressions..
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 ?




Report this thread to moderator Post Follow-up to this message
Old Post

11-29-04 09:00 PM


Re: Starting out inreg expressions..
127.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


Report this thread to moderator Post Follow-up to this message
Old Post
Toby Inkster
11-29-04 09:00 PM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

PERL Programming archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 06:58 AM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.