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 wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

REFindNoCase 1

Status
Not open for further replies.

mimi2

Technical User
Apr 2, 2002
407
CA
Hello,
what is the meaning of this code ?
<cfset start=#find(&quot;>&quot;,chain,REFindNoCase(&quot;<h[0-9]&quot;,chain,1))# + 1>
thanks
 
Hey Mimi,

That code will find the starting point of text just after the first heading tag in some html. The ReFindNoCase statement will search the string &quot;chain&quot; starting at position 1 until it finds an expression matching the RE expression &quot;<h[0-9]&quot;. If your not familiar with RE expressions, any of the following will be found.

<h0
<h1
<h2
<h3
....
<h9

When this is found, the find statement then starts searching for the next occurance of &quot;>&quot; and then adds 1. If your html contained this &quot;<html><body><h1>My Text</h1></body></html>&quot;, Start would contain the numer 17 which is the starting point for &quot;M&quot;, the first character after the <h1> heading tag.

It might be a little easier to see how it works like this:
<cfset start=#REFindNoCase(&quot;<h[0-9]&quot;,chain,1)#>
<cfset start=#find(&quot;>&quot;,chain,start)>
<cfset start=start + 1>

Hope this helps,
GJ
 
Status
Not open for further replies.

Similar threads

Part and Inventory Search

Sponsor

Back
Top