I just ran...

<cfset myVal = '000000000009970656'>
<cfoutput>
        <p>#reReplace(myVal,'^0','','ALL')#</p>
</cfoutput>

and it does indeed replace only the first 0, it needs "^0+" if you
want to strip them all.

The function doesn't do an recursion and only the first "0" is next to
the start (^) of the string.

--
Jay

On Tue, Apr 1, 2008 at 4:04 PM, Dawson, Michael <[EMAIL PROTECTED]> wrote:
> Interesting.  Have you actually confirmed that it won't work?
>
>  The regex should only strip a single zero character from the beginning
>  of the string.  However, the ALL argument is specified.
>
>  I would agree with you that it should not strip more than one leading
>  zero, but does the ALL argument cause the function to recursively run
>  the regex until all leading zeros are removed?
>
>  Either way, the function should probably be updated to what you would
>  expect to see.
>
>  reFind(origString, "^0+", "")
>
>  m!ke
>
>
>  -----Original Message-----
>  From: James Smith [mailto:[EMAIL PROTECTED]
>
> Sent: Tuesday, April 01, 2008 9:52 AM
>  To: CF-Talk
>  Subject: Re: Trim leading zeros
>
>
>
> > CFLib.org has a UDF that does this:
>  >
>  >  http://cflib.org/udf.cfm?ID=239
>
>  That wouldn't work, looking at the code for that UDF it would only strip
>  the first zero...
>
>  --
>  Jay
>
>
> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;192386516;25150098;k

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:302437
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Reply via email to