--- John Halderman <jhalderman / gmail.com> wrote:

> I'm not sure if this is a bug or intentional behavior, so I
> thought I would 
> post it here to see what the community thought of what was
> happening. If you 
> set up a StringScanner object to perform iterative matching
> on a string the 
> behavior of \A and ^ seem to always match. It seems to me
> that \A should 
> only match if it is the first match performed, and ^ should
> only match if 
> bol? returns true, which should be after a \n or if it is the
> first match 
> performed.

You should think of the current position as the beginning of
the string for matching.  In addition, the regexp that scan
gets is implicitly anchored to that spot.  So specifiing \A or
^ at the beginning of a regexp for scan is redundant.



		
__________________________________ 
Do you Yahoo!? 
Yahoo! Mail - Find what you need with new enhanced search. 
http://info.mail.yahoo.com/mail_250