[thelist] Regex help

Tab Alleman talleman at Lumpsum.com
Wed May 2 16:51:46 CDT 2007


Except I was overly subtle in describing my string.  The string begins and ends with any combination of characters which could include START, so there might be more than two START's in the string.  I really need to specifcally grab instances of START that are followed by END before another START.

> -----Original Message-----
> From: thelist-bounces at lists.evolt.org
> [mailto:thelist-bounces at lists.evolt.org]On Behalf Of Anthony Baratta
> Sent: Wednesday, May 02, 2007 5:15 PM
> To: thelist at lists.evolt.org
> Subject: Re: [thelist] Regex help
> 
> 
> Here's what I came up with:
> 
> START(.*?)START(.*?)END
> 
> Will return 3 groups of matches. The first group will be 
> everything between the first START and the END. The second 
> group will be everything between the first START and the 
> SECOND start, and the last group will be everything between 
> the second START and the END.
> 
> You can test the above REGEX against any test strings you have here:
> 
> http://www.fileformat.info/tool/regex.htm
> 
> Hopefully that will get your "started". ;-)
> 
> -----Original message-----
> From: "Tab Alleman" talleman at Lumpsum.com
> Date: Wed, 02 May 2007 13:16:10 -0700
> To: "Evolt Thelist \(E-mail\)" thelist at lists.evolt.org
> Subject: [thelist] Regex help
> 
> > Been trying to figure this out, but I haven't found a way 
> to do what I want in any of the tutorials out there.
> > 
> > Say I've got a string like this:
> > 
> > any combination of characters + "START" + any combination 
> of characters except START + "START" + any combination of 
> characters except START + "END" + any combination...
> > 
> > 
> > 
> > I want to create a regex that will grab the chunk of the 
> string between the SECOND "START" and the next "END".  The 
> pattern I created grabs from the FIRST "START" to the first "END":
> > 
> > START.*?END
> > 
> > 
> > 
> > -- 
> > 
> > * * Please support the community that supports you.  * *
> > http://evolt.org/help_support_evolt/
> > 
> > For unsubscribe and other options, including the Tip Harvester 
> > and archives of thelist go to: http://lists.evolt.org 
> > Workers of the Web, evolt ! 
> > 
> -- 
> 
> * * Please support the community that supports you.  * *
> http://evolt.org/help_support_evolt/
> 
> For unsubscribe and other options, including the Tip Harvester 
> and archives of thelist go to: http://lists.evolt.org 
> Workers of the Web, evolt ! 
> 



More information about the thelist mailing list