I need to get a list of all the TODOs in a list of (primarily .cfm) files.
In the unlikely event of people not being familiar with TODOs, they're just
CFML comments like this:
<!--- TODO: Thing I have to do --->
The presence of the TODO: then flags up that something needs to be
addressed. Very useful when you want to shove in some dummy data and return
later to fix it. (Good editors can flag TODOs - eg: CFEclipse puts a blue
bar next to the scrollbar)
Currently I've got some regex to convert file contents into a pipe-delimited
list, but I've been getting odd results and it has now started giving me
buffer overflow errors for no clear reason.
Here's the current code:
<cfset Tasks = REReplace(Contents,'.*?(<!---
TODO:)(.*?)(?=--->)([^<]|<[^!]|<!--[^-]|<!---\s+[^T])*','\2|','all')/>
<ul>
<cfloop index="i" list="#Tasks#" delimiters="|">
<li>#i#</li>
</cfloop>
</ul>
I'm sure there has to be a better way of doing it than that, but I think
I've been working on the problem for too long to figure it out myself, so if
anyone here is able to offer a better solution it would be very much
appreciated.
Thanks.
--
\ \
Peter Boughton
blog.bpsite.net
/ /
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Upgrade to Adobe ColdFusion MX7
The most significant release in over 10 years. Upgrade & see new features.
http://www.adobe.com/products/coldfusion?sdid=RVJR
Archive:
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:274514
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe:
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4