Assuming there is just one comment block, cffile read the file and try this
on it...
trim(rereplace(rereplace(theFileContent, "(.*?<!-{3})(.*?)(-->.*)", "\2",
"all"), "(.*?):(.*?)#chr(13)#", "\1", "all"))
It will find and use only the first CF comment block that it finds...
meaning everything in the file starting with the first instance of <!--- and
ending with the next instance of --->
..:.:.:.:.:.:.:.:.:.:.:.
Bobby Hartsfield
http://acoderslife.com
-----Original Message-----
From: Philip Hayes [mailto:[EMAIL PROTECTED]
Sent: Wednesday, January 23, 2008 10:53 AM
To: CF-Talk
Subject: Regular Expression To Pull Values From A Commented Area
I need some help with an area of ColdFusion which I would call my
Achilles Heal of ColdFusion Programming. I cannot get my mind around
Regular Expressions, but know its the solution to many of my
problems. For example
I have the following CF Comment on a cfm page:
<!---
Widget Name: My Widget
Widget URL: http://siriusinnovations.com
Description: This is the description
Version: 2.0
Author: Philip Hayes
Author URL: http://siriusinnovations.com
--->
I want to perform a read on the CFM file using CFFILE. I then want
to use a find/replace with regular expressions to find the values for:
Widget Name
Widget URL
Description
Version
Author
Author URL
Is there anybody out there who can help me do this? I know is
probably pretty easy but i just don't get regular expressions.
Thanks.
Phil
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to
date
Get the Free Trial
http://ad.doubleclick.net/clk;160198600;22374440;w
Archive:
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:297161
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4