Q:

Is there a simple way to remove ColdFusion comments from a file? 

Is there a quick way to remove all of the comments from a Coldfusion File?  I have to work on a file that is mostly comments (especially comments of old non-functional code), and I'd like to create a temporary version with no comments and functional code only. 
I generally use Notepad++ to edit CFM files, but I also have ColdFusion Studio. 
Any help is appreciated! 

A:

With CFML you can do it with a quick regex.  This only works with CFML tag based comments, not script ones. 
<cfset contents = fileRead(expandPath("./test2.cfm"))>
<cfset noComments = rereplace(contents, "<!---.*?--- >", "", "all")>
<cfoutput>
#htmlCodeFormat(noComments)#
</cfoutput>

