That's fine if the first character cannot be 0, if it can, your
conditional will return false.
Also, I bet mid is faster than a regular expression find.
Furthermore, it seems that "Find" would do the job. REFind is overkill
because you're not even checking against a regular expression.
REFindNoCase is even more overkill since you're checking against a
digit, not an alpha character.
I'm being anal (except for my first paragraph), but I still would
suggest:
<cfif mid(string, 2, 1) IS 0>
Jamie
On Wed, 5 Dec 2001 12:59:42 -0500, in cf-talk you wrote:
>I figured it out:
>
><CFIF REFindNoCase('0', string) EQ 2>do something</CFIF>
>
>Dave
>
>
>----- Original Message -----
>From: "Dave Hannum" <[EMAIL PROTECTED]>
>To: "CF-Talk" <[EMAIL PROTECTED]>
>Sent: Wednesday, December 05, 2001 12:42 PM
>Subject: A little RegEx help . . .
>
>
>I need to look and see if the second character of a three character
string
>is a "0" (zero). How would I do that?
>
><CFIF (insert regex here)> do something </CFIF> 8-)
>
>Thanks,
>Dave
>
>
>
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at
http://www.fusionauthority.com/bkinfo.cfm
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists