[thelist] Perl Regex

Bruce Heerssen bheerssen at visualbridge.tv
Thu Apr 5 10:54:35 CDT 2001


Can anyone provide a method for doing the same in ColdFusion? I'm currently
doing this with a less efficient method ( #listGetAt('<TITLE>Test
title</TITLE>', 2, "<>")# )

The problem with this is that a) it uses list functions which may not be as
efficient as regexps -- which is important for my application -- and b) if the
list contains only one element, then the code bombs.

Also, if anyone has some links to good resources for using regexps in CF, I
would be eternally grateful. The CF docs are a little sparse in this department.

Thanks,

Bruce
(who wishes he could really get a handle on regexps)

-----Original Message-----
From: Matthew Fischer <mfischer at e-fishsolutions.com>
To: thelist at lists.evolt.org <thelist at lists.evolt.org>
Date: Wednesday, April 04, 2001 10:05 AM
Subject: Re: [thelist] Perl Regex


>On 4/4/01 at 9:29 AM, Manish Sharma <msharma at satyam.net.in> wrote:
>
>> What's the best Perl Regex that matches HTML tags in a line?
>
>
>$string = "<TITLE>Test title</TITLE>";
>$string =~ s/<[^>]+>//g;
>print "$string";
>
>Result:
>   "Test title"
>
>The expression matches all occurrences of a "<", followed by one or more
characters that aren't a ">", followed by a ">". If you don't have the "g"
at the end, it will only match the first occurrence.
>





More information about the thelist mailing list