Assuming the test containing the source is a variable named text.
the following will return a comma-delimited list of function names


<cfset myFunctions = Replace(text, "@", "", "all")>
<cfset myFunctions = ReplaceNoCase(myFunctions, "function", "@", "all")>
<cfset myFunctions = ReReplaceNoCase(myFunctions, "[^@]*@[ 
]+([a-z0-9_]+)[^@]*", "\1,", "all")>

HTH

Dick



At 3:59 PM -0500 7/17/01, Bryan LaPlante wrote:
>I need some help from one of the RegExp guru's. I am trying to get a list of
>function names from my page for example the following functions name resides
>in the page at position 9 to 17. I need a regular expression that will find
>everything between the word function and the parenthesis character ( so that
>I can get the word addition into a list. Here is what I have so far.
>
><cfset funcName = refindnocase("([function]+) [ ]+
>\(",thistag.generatedcontent,1,true)>
>
>function addition(a,b){
>somevar = a + b;
>return somevar;
>}
>
>Bryan LaPlante
>
>
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to