Christopher S Martin asked:
> How well does ColdFuison support Regular Expressions?
Ah, the topic has come 'round again. :) This question gets asked about
once a month, so I guess it was time again. :) But, if no one asked it,
then I wouldn't have an excuse to plug my CFX tag.
Ahem-hem.
<soapbox>
The built-in CF regexs are okay for mild to moderate use, but anyone who ise
used to Perl (or grep) is going to choke when they try to do some of the
stuff they are used to (escape sequences and non-greedy matches especially).
CF regexes also seem (to me) to be single-use oriented, which is to say that
I think there are too many hoops to jump through to perform repeated matches
and replaces on a string. However, CF regexs tend to be prettier (which is
to say more readable) because they don't support most backslash escape
sequences, only the POSIX versions. (That is, you cannot say '\W', you must
say '[:alnum:]', which is a loose interpretation at best.) Once you get
used to them, CF regexes aren't so bad, but they definitely have some
limitations.
</soapbox>
<plug type=blatant>
However, there is hope. I just completed a CFX tag that uses the PCRE (Perl
Compatible RegEx) engine and uploaded it to the tag gallery not 2 weeks ago.
It will give you complete compatibility with Perl regexes, and quite often
superior performance. It'll even do subexpressions (more efficiently than
CF) and Replace()-style functionality (with backreferences to
subexpressions). It's free and even comes with source (under the GPL). In
short: it's a free alternative to the built-in CF functionality that is more
functional, more flexible, and can even be faster if implemented correctly.
</plug>
If you run into a regex that you simply cannot translate into a
CF-compatible state, snag a copy of the CFX and see if it works for you.[1]
If it does, email the author and let him know that he rocks. Programmers
like that kind of thing.
-Rick
[1]
http://devex.allaire.com/developer/gallery/info.cfm?id=47AA9175-9AFE-11D4-AA
A700508B94F380&method=full
------------------------------------------------------------------------------
Archives: http://www.mail-archive.com/[email protected]/
To Unsubscribe visit
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.