[#3228] Core support for Gems, and namespace — "Luke A. Kanies" <luke@...>

Hi all,

21 messages 2004/07/27
[#3230] Re: Core support for Gems, and namespace — Austin Ziegler <halostatue@...> 2004/07/27

On Tue, 27 Jul 2004 11:39:08 +0900, Luke A. Kanies <luke@madstop.com> wrote:

[#3234] Re: Core support for Gems, and namespace — "Luke A. Kanies" <luke@...> 2004/07/27

On Tue, 27 Jul 2004, Austin Ziegler wrote:

[#3238] Re: Core support for Gems, and namespace — Austin Ziegler <halostatue@...> 2004/07/27

On Wed, 28 Jul 2004 00:14:29 +0900, Luke A. Kanies <luke@madstop.com> wrote:

Re: Trying to understand \G

From: matz@... (Yukihiro Matsumoto)
Date: 2004-07-17 04:49:04 UTC
List: ruby-core #3202
Hi,

In message "Re: Trying to understand \G"
    on 04/07/17, Dave Thomas <dave@pragprog.com> writes:

|> '\G' only works for repeating match methods, String#gsub, String#scan,
|
|Ah - I see. So when using scan, why does the following:
|
|   str = "abcdefg"
|   str.scan(/.\G.|../)  #=>  [ ab cd ef ]
|
|not return [ ab bc cd de ef fg] ?

\G matches at the end of point of the last match.  The next match
starts at the point and never backtracks, so that \G at anywhere but
head of the pattern never matches.

|Or, putting it another way, is \G actually useful in #scan?

Not really.  It's there just because it's not impossible.

							matz.

In This Thread