how do i go about using these results?

after running your regex, i imagine you get a structure returned whose keys
are len and pos. you could then use those in the mid function to retrieve
the string. however, when i run:

<cfset testvar='function addition(a,b){
somevar = a + b;
return somevar;
}
'>

<cfset
regextestvar=refindnocase("(function)(.)([[:graph::]]*)\(",testvar,1,true)>

<cfoutput>

<cfloop collection="#regextestvar#" item="key">
#key#:: #regextestvar[key]#
</cfloop>

</cfoutput>

i get:

Error Diagnostic Information

 Expression result cannot be converted to a string

 Expressions used inside tags like CFOUTPUT, CFQUERY, CFMAIL, etc. must
evaluate to a value that can be converted to a string for output or dynamic
text accumulation purposes. Complex objects,
 such as queries, arrays, and COM/DCOM objects, cannot be represented as
strings.

?

-----Original Message-----
From: Marlon Moyer [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, July 17, 2001 7:24 PM
To: CF-Talk
Subject: RE: Regexp help


refindnocase("(function)(.)([[:graph::]]*)\(",thistag.generatedcontent,1,tru
e)>

Marlon

-----Original Message-----
From: Bryan LaPlante [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, July 17, 2001 4:00 PM
To: CF-Talk
Subject: Regexp help


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