result = REreplace(string,
      "$.*(<%---.*---%>).*^",
      "\1");

That should do it, although it'll cause problems if there is more than one
<%--- ---%> block in thr string.  If the string you're looking for never
contains a  greater than sign, then you can use this RE instead, which will
then work for strings that have multiple target blocks in there:

     $.*(<%---[^>]*---%>).*^

It'll still only pull out the first block, so you'll need some kind of
looping mechanism, but it'll return the first block correctly, rather than a
combined result.

---
Barney Boisvert, Senior Development Engineer
AudienceCentral (formerly PIER System, Inc.)
[EMAIL PROTECTED]
voice : 360.756.8080 x12
fax   : 360.647.5351

www.audiencecentral.com

> -----Original Message-----
> From: Michael Tangorre [mailto:[EMAIL PROTECTED]
> Sent: Monday, June 02, 2003 11:20 AM
> To: CF-Talk
> Subject: regex help needed
>
>
> Can someone assist me in writing the following regex...
> I have a string, varies in length and I need to pull out of the
> string all the characters between:   <%--- and  ---%>
> An example of what this string might look like is:
>
> "dllCall1<%---session|errorTrap|DetailNumeric---%>EndDLLCall"
> I need to pull:  <%---session|errorTrap|DetailNumeric---%>
>
> The surroudning text will always vary in length depending upon results....
>
> Thanks,
>
> Michael Tangorre
> ========================
> [EMAIL PROTECTED]
> www.realmagnet.com
> work - 202-244-7845
> fax - 202-244-7926
> cell - 607-426-9277
> ========================
> 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: 
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq

Signup for the Fusion Authority news alert and keep up with the latest news in 
ColdFusion and related topics. 
http://www.fusionauthority.com/signup.cfm

                                Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
                                

Reply via email to