Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

help w/ regular expressions

Status
Not open for further replies.

aarontra

Programmer
Oct 2, 2002
50
US
I am trying to have a generic way of finding out about the realtionships of pages to one another.
Like page form1.cfm post to form1handler.cfm
And page usecustomtags.cfm uses custom tags <cf_font>,<cf_wrapper> ...

I have it so I can read the directory loop through each file, but I am having trouble with the working with coldfusion regular expressions.

I can find one form with:
<CFSCRIPT>
reg_expression = &quot;action=[^>]*>&quot;;
mystub=&quot;True&quot;;
mystruct = REFindNoCase(reg_expression,text,1,mystub);
</CFSCRIPT>

but I do not know how to get back mulitple matches like:

<CFSET st1 = REFindNoCase(&quot;([[:alpha:]]+)[ ]+(\1)&quot;,testString,1,&quot;TRUE&quot;)>

Any help would be appreciated.
Thank you
Aaron

 
I can definitely help you with this, but I'm a little unclear on what exactly you want to know. Are you looking for information on how to search the whole document for multiple matches on your RegExp pattern? Or are you looking to retrieve the value of a subpattern within the match?

-pcorreia
 
code for testpage1.cfm
Code:
<cf_wrapper title=&quot;test page 1&quot;>
<cf_customtag1 page=&quot;1&quot;>
<cf_font>This is a test page.</cf_font>
<cf_customtag2 x=&quot;1&quot;>
<cf_font size=&quot;+1&quot;>test test testing</cf_font>
</cf_wrapper>

I want to be able to search the text above for all calls to custom tags. But maybe ignore really common ones like <cf_font> ...

And generate a &quot;report&quot; like:
testpage1.cfm calls custom tag cf_wrapper customtag1, customtag2

Sort of documentation based on the code.

Thank you
Aaron


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top