[#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-27 07:43:04 UTC
List: ruby-core #3231
Hi,

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

|I thought I understood this, but when I tried to document it, I found 
|out that I didn't. Is there any reasonable situation in which adding \G 
|to a pattern is useful? For example, in the loop above, I believe the 
|only place a \G may occur is at the front of the pattern. If that's the 
|case, then isn't  /\G<rest>/ equivalent to /<rest>/?

\G forces <rest> to match immediately after the last match (or
beginning of a string).

p "a01b20c30 d40".scan(/[a-z]\d+/)
p "a01b20c30 d40".scan(/\G[a-z]\d+/)

							matz.

In This Thread