*smacks forehead*
Now I feel stupid.  You are absolutely right.  Must need caffeine or 
something.

--ben

Barney Boisvert wrote:

> The carat inside the class negates the class.  So the RE returns the first
> character that's not a CR or LF (the first character we don't want to
> count), subtracts one for that character, and then divides by two.  I don't
> need to mess with the start of the string, because that's the way REfind
> works by default (can be overridden by passing in the 'start' parameter).
> 
> Given the string
>    CR & LF & CR & LF & CR & LF & "hello"
> REfind() will return 7 (for the 'h'), minus 1 is 6, divide by 2 is three,
> which is the number of CRLF pairs.
> 
> barneyb
> 
> 
>>-----Original Message-----
>>From: Ben Doom [mailto:[EMAIL PROTECTED]
>>Sent: Thursday, September 25, 2003 12:25 PM
>>To: CF-Talk
>>Subject: Re: Counting CRLF
>>
>>
>>There are 2 problems with what you wrote.  The carat inside the class
>>will accept carats, also.  The carat not outside the class means that it
>>won't stop at the beginning.  So, this will return the position of the
>>first carat, cr, or lf that it finds, divided by two.
>>
>>Mine actually returns the string of cr/lfs leading, finds the len, and
>>divides by 2 to (hopefully) return the correct number of linebreaks.
>>
>>--ben
> 
> 
> 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Purchase from House of Fusion, a Macromedia Authorized Affiliate and support the CF 
community.
http://affiliates.macromedia.com/t.asp?id=2439&p=go/dr_text_aff1

Message: http://www.houseoffusion.com/lists.cfm?link=i:4:138530
Archives: http://www.houseoffusion.com/lists.cfm?link=t:4
Subscription: http://www.houseoffusion.com/lists.cfm?link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Reply via email to