This is the way I managed to get it to work

<cfset st = refind("Semester: [0-9]*", cfhttp.fileContent, 0, "TRUE")>
<cfdump
var="#right(left(cfhttp.fileContent,st.pos[1]+st.len[1]-1),2)#">

Looks like using the array would be more efficient though...

>>> [EMAIL PROTECTED] 01/09/04 05:33am >>>
[EMAIL PROTECTED] wrote:
> I'm trying to extract the number 23 which follows the string
Semester:
> 
> Is this a job for regex?

Sure, this should do the trick:

<cfscript>
stMatch = REFind("Semester:\s*([1-9]+)", s, 1, true);
if(stMatch.pos[1] NEQ 0){
        for(i = 2; i LTE ArrayLen(stMatch.pos); i = i + 1){
                WriteOutput(i & ": " & Mid(s, stMatch.pos[i],
stMatch.len[i]) & "<br>");
        }
}
</cfscript>

-- 
 Lindsay Evans.
 Developer,
 Red Square Productions.

 [p] 8596.4000
 [f] 8596.4001
 [w] www.redsquare.com.au 


---
You are currently subscribed to cfaussie as: [EMAIL PROTECTED]

To unsubscribe send a blank email to
[EMAIL PROTECTED] 

MXDU2004 + Macromedia DevCon AsiaPac + Sydney, Australia
http://www.mxdu.com/ + 24-25 February, 2004

---
You are currently subscribed to cfaussie as: [EMAIL PROTECTED]
To unsubscribe send a blank email to [EMAIL PROTECTED]

MXDU2004 + Macromedia DevCon AsiaPac + Sydney, Australia
http://www.mxdu.com/ + 24-25 February, 2004

Reply via email to