mkishline, in coldfusion you don't really have to specify the start and end of a regex with ^ and $.
It's not incorrect, it definitely does work, just adding my 2 cents...
here's my version...
<cfscript>
testvalue = '100:900';
if(refind('([0-9]+:[0-9]+)
writeoutput('test passed');
}else{
writeoutput('test failed');
}
</cfscript>
Main Topics
Browse All Topics





by: mkishlinePosted on 2006-03-14 at 06:50:00ID: 16183857
<cfset check = REFind("^[0-9]+:[0-9]+$",s tr) />
<cfif check GT 0>
<!--- The number is a valid ratio --->
<cfelse>
<!--- The number is not a valid ratio --->
</cfif>