----- Original Message -----
From: "Stephen White" <spwhite / chariot.net.au>
To: "ruby-talk ML" <ruby-talk / ruby-lang.org>
Sent: Tuesday, June 05, 2001 11:27 AM
Subject: [ruby-talk:16237] Re: String#scan strange behavior


> On Wed, 6 Jun 2001, Wayne Blair wrote:
>
> > aString="one two three"
> > matches = []
> > regexp = /(\w)+/  # current scan would return [["e"], ["o"], ["e"]]
> > aString.simpleScan(regexp) # => ["one", "two", "three"]
>
> Already seems to be that way if you don't use sub-expressions.
>
>   irb(main):006:0> "one two three".scan(/\w+/)
>   ["one", "two", "three"]
>
> Works for me anyway. :)

Right, but if you have to use a subexpression, you are out of luck, for
example when you want to match between 2 quotes but allow for escaped
quotes:

/"(\\"|[^"])*"/

Wayne