Sorry to bug you again, but can you do a quick sanity check? I think this
one works:

<h[^h]*h[0-9]

That finds any element that starts with <h and ends with hnum. I don't have
to grab it perfectly, as long as I grab the contents...

Ian

-----Original Message-----
From: Matthew Walker [mailto:[EMAIL PROTECTED]]
Sent: Sunday, September 22, 2002 10:39 PM
To: CF-Talk
Subject: RE: Regex help, again


> But I actually need what's between the <hnum> and </hnum> and it DOES
> include HTML.
>
> Sigh...

You can only do it in CFMX. CF5 uses greedy regex matching. If you
simply wrote <h[0-9]>(.*)</h[0-9]> then you would match say the first
<h1> and the last </h1> in the doc. If there's only one, that would be
fine, but if not you have a problem. With CFMX you can use non-greedy
matching so this is resolved.

How I would do it is first search for the <h?> and then search for the
next </h?> from that point on. Then use mid() to cut out the matched
section.

______________________________________________________________________
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to