[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Re: Finding un-escaped characters in scan

Wolfgang Nádasi-donner

7/30/2007 7:50:00 PM

Fred Phillips wrote:
> I have a string that looks like this: "test,,\,test". And I'm trying to
> count the commas which don't follow a \. But when using scan(/[^\\],/)
> it
> only finds the first comma. I think this is because after scan() has
> found a
> comma without a backslash, it continues from where it left off, and
> since
> there's no character before the next comma, it won't match it. Does
> anyone
> know how to fix it?

If you can use Ruby 1.9, you simly can express it using 'negative look
behind':


irb(main):001:0> "test,,\\,test".scan(/(?<!\\),/)
=> [",", ","]
irb(main):002:0> "test,,\\,test,test2,\\,test3".scan(/(?<!\\),/)
=> [",", ",", ",", ","]

Wolfgang Nádasi-Donner
--
Posted via http://www.ruby-....

16 Answers

jess stone

9/6/2012 9:18:00 PM

0

On Thu, 06 Sep 2012 17:07:15 -0400, Mason Barge <masonbarge@gmail.com>
wrote:


>I've always sort of liked her, even though I can't remember her in a role
>that I liked. Maybe I should add her to the "I'm Not Bad, I'm Just
>Written That Way" thread.

I never watched Grey and she was mostly background in 24 however did
you ever see her in "Third Watch?" She was yummy and in charge back
then.

Ian J. Ball

9/6/2012 10:15:00 PM

0

In article <k2as3l$r8n$1@dont-email.me>,
Robin Miller <complex.gal@invalid.com> wrote:

> David wrote:
>
> > http://tvline.com/2012/09/05/revolution-casts-...
> >
> > Exclusive: Grey's Anatomy Alum Kim Raver Joins in NBC's Revolution
> > by Matt Webb Mitovich
> >
> > NBC?s Revolution drama, now viewable online but officially premiering
> > Sept. 17, has recruited Grey?s Anatomy alum Kim Raver for a juicy
> > recurring role.
>
> This will be, um, met with a mixed reaction.

I neither like her, or particularly dislike her.

I will say this, though - this does it make it slightly *less* likely
that I will sample this, when I was already leaning in the direction of
not sampling it.

--
"Surf-crazed aliens... Of course." - Amber, "Alien Surf Girls",
Episode #1.1, "Wipeout".
Wait a minute... "Of course"?! "*Of course*"?!! Did I miss a step here??!!

Anim8rFSK

9/6/2012 10:17:00 PM

0

In article <914i489q6js29crfvjc613i1ns1vaka4ve@4ax.com>,
Mason Barge <masonbarge@gmail.com> wrote:

> On Thu, 06 Sep 2012 15:04:19 -0400, Robin Miller <complex.gal@invalid.com>
> wrote:
>
> >David wrote:
> >> http://tvline.com/2012/09/05/revolution-casts-...
> >>
> >> Exclusive: Grey's Anatomy Alum Kim Raver Joins in NBC's Revolution
> >> by Matt Webb Mitovich
> >>
> >> NBC?s Revolution drama, now viewable online but officially premiering
> >> Sept. 17, has recruited Grey?s Anatomy alum Kim Raver for a juicy
> >> recurring role.
> >
> >
> >This will be, um, met with a mixed reaction.
>
> She can't really hurt anything :)
>
> I've always sort of liked her, even though I can't remember her in a role
> that I liked. Maybe I should add her to the "I'm Not Bad, I'm Just
> Written That Way" thread.

She seems to have a long resum? of shows I haven't watch or studiously
avoided. The only things I'd have seen her in are an episode of Law &
Order and Night at the Museum ...

--
"Every time a Kardashian gets a TV show, an angel dies."

Shane Crowe

9/7/2012 12:13:00 AM

0

On Thu, 06 Sep 2012 15:04:19 -0400, Robin Miller
<complex.gal@invalid.com> wrote:

>David wrote:
>> http://tvline.com/2012/09/05/revolution-casts-...
>>
>> Exclusive: Grey's Anatomy Alum Kim Raver Joins in NBC's Revolution
>> by Matt Webb Mitovich
>>
>> NBC?s Revolution drama, now viewable online but officially premiering
>> Sept. 17, has recruited Grey?s Anatomy alum Kim Raver for a juicy
>> recurring role.
>
>This will be, um, met with a mixed reaction.

Hey! Good ol' horseface is back!

Anim8rFSK

9/7/2012 12:20:00 AM

0

In article
<ijball-NO_SPAM-E33282.15143106092012@news.eternal-september.org>,
"Ian J. Ball" <ijball-NO_SPAM@mac.invalid> wrote:

> In article <k2as3l$r8n$1@dont-email.me>,
> Robin Miller <complex.gal@invalid.com> wrote:
>
> > David wrote:
> >
> > > http://tvline.com/2012/09/05/revolution-casts-...
> > >
> > > Exclusive: Grey's Anatomy Alum Kim Raver Joins in NBC's Revolution
> > > by Matt Webb Mitovich
> > >
> > > NBC's Revolution drama, now viewable online but officially premiering
> > > Sept. 17, has recruited Grey's Anatomy alum Kim Raver for a juicy
> > > recurring role.
> >
> > This will be, um, met with a mixed reaction.
>
> I neither like her, or particularly dislike her.

And there's your mixed reaction.
>
> I will say this, though - this does it make it slightly *less* likely
> that I will sample this, when I was already leaning in the direction of
> not sampling it.

Not even to share the snark??

--
"Every time a Kardashian gets a TV show, an angel dies."

Dimensional Traveler

9/7/2012 1:58:00 AM

0

On 9/6/2012 5:20 PM, anim8rFSK wrote:
> In article
> <ijball-NO_SPAM-E33282.15143106092012@news.eternal-september.org>,
> "Ian J. Ball" <ijball-NO_SPAM@mac.invalid> wrote:
>
>> In article <k2as3l$r8n$1@dont-email.me>,
>> Robin Miller <complex.gal@invalid.com> wrote:
>>
>>> David wrote:
>>>
>>>> http://tvline.com/2012/09/05/revolution-casts-...
>>>>
>>>> Exclusive: Grey's Anatomy Alum Kim Raver Joins in NBC's Revolution
>>>> by Matt Webb Mitovich
>>>>
>>>> NBC's Revolution drama, now viewable online but officially premiering
>>>> Sept. 17, has recruited Grey's Anatomy alum Kim Raver for a juicy
>>>> recurring role.
>>>
>>> This will be, um, met with a mixed reaction.
>>
>> I neither like her, or particularly dislike her.
>
> And there's your mixed reaction.
>>
>> I will say this, though - this does it make it slightly *less* likely
>> that I will sample this, when I was already leaning in the direction of
>> not sampling it.
>
> Not even to share the snark??
>
I predict her appearance will be when the show jumps the snark.

(No, that's not a typo.)

Ian J. Ball

9/7/2012 3:48:00 PM

0

In article <anim8rfsk-16EE80.17200606092012@news.easynews.com>,
anim8rFSK <anim8rfsk@cox.net> wrote:

> In article
> <ijball-NO_SPAM-E33282.15143106092012@news.eternal-september.org>,
> "Ian J. Ball" <ijball-NO_SPAM@mac.invalid> wrote:
>
> > In article <k2as3l$r8n$1@dont-email.me>,
> > Robin Miller <complex.gal@invalid.com> wrote:
> > > David wrote:
> > >
> > > > http://tvline.com/2012/09/05/revolution-casts-...
> > > >
> > > > Exclusive: Grey's Anatomy Alum Kim Raver Joins in NBC's Revolution
> > > > by Matt Webb Mitovich
> > > >
> > > > NBC's Revolution drama, now viewable online but officially premiering
> > > > Sept. 17, has recruited Grey's Anatomy alum Kim Raver for a juicy
> > > > recurring role.
> > >
> > > This will be, um, met with a mixed reaction.
> >
> > I neither like her, [n]or particularly dislike her.
>
> And there's your mixed reaction.
>
> > I will say this, though - this does it make it slightly *less* likely
> > that I will sample this, when I was already leaning in the direction of
> > not sampling it.
>
> Not even to share the snark??

I've grown out of that phase. I didn't watch most of "The Event" for the
same reason - I have too high a "bullshit" detector for 'storyarced'
Speculative Fiction now. "Flash Forward" was the last one of those that
I'm going to sit through despite its idiocy. Those days are over for me.

Perfect SF series, or Bust!!

--
"Surf-crazed aliens... Of course." - Amber, "Alien Surf Girls",
Episode #1.1, "Wipeout".
Wait a minute... "Of course"?! "*Of course*"?!! Did I miss a step here??!!

Mason Barge

9/7/2012 4:44:00 PM

0

On Thu, 06 Sep 2012 18:58:02 -0700, Dimensional Traveler
<dtravel@sonic.net> wrote:

>On 9/6/2012 5:20 PM, anim8rFSK wrote:
>> In article
>> <ijball-NO_SPAM-E33282.15143106092012@news.eternal-september.org>,
>> "Ian J. Ball" <ijball-NO_SPAM@mac.invalid> wrote:
>>
>>> In article <k2as3l$r8n$1@dont-email.me>,
>>> Robin Miller <complex.gal@invalid.com> wrote:
>>>
>>>> David wrote:
>>>>
>>>>> http://tvline.com/2012/09/05/revolution-casts-...
>>>>>
>>>>> Exclusive: Grey's Anatomy Alum Kim Raver Joins in NBC's Revolution
>>>>> by Matt Webb Mitovich
>>>>>
>>>>> NBC's Revolution drama, now viewable online but officially premiering
>>>>> Sept. 17, has recruited Grey's Anatomy alum Kim Raver for a juicy
>>>>> recurring role.
>>>>
>>>> This will be, um, met with a mixed reaction.
>>>
>>> I neither like her, or particularly dislike her.
>>
>> And there's your mixed reaction.
>>>
>>> I will say this, though - this does it make it slightly *less* likely
>>> that I will sample this, when I was already leaning in the direction of
>>> not sampling it.
>>
>> Not even to share the snark??
>>
>I predict her appearance will be when the show jumps the snark.
>

Too late.

Mason Barge

9/7/2012 5:18:00 PM

0

On Fri, 07 Sep 2012 08:48:23 -0700, "Ian J. Ball"
<ijball-NO_SPAM@mac.invalid> wrote:

>In article <anim8rfsk-16EE80.17200606092012@news.easynews.com>,
> anim8rFSK <anim8rfsk@cox.net> wrote:
>
>> In article
>> <ijball-NO_SPAM-E33282.15143106092012@news.eternal-september.org>,
>> "Ian J. Ball" <ijball-NO_SPAM@mac.invalid> wrote:
>>
>> > In article <k2as3l$r8n$1@dont-email.me>,
>> > Robin Miller <complex.gal@invalid.com> wrote:
>> > > David wrote:
>> > >
>> > > > http://tvline.com/2012/09/05/revolution-casts-...
>> > > >
>> > > > Exclusive: Grey's Anatomy Alum Kim Raver Joins in NBC's Revolution
>> > > > by Matt Webb Mitovich
>> > > >
>> > > > NBC's Revolution drama, now viewable online but officially premiering
>> > > > Sept. 17, has recruited Grey's Anatomy alum Kim Raver for a juicy
>> > > > recurring role.
>> > >
>> > > This will be, um, met with a mixed reaction.
>> >
>> > I neither like her, [n]or particularly dislike her.
>>
>> And there's your mixed reaction.
>>
>> > I will say this, though - this does it make it slightly *less* likely
>> > that I will sample this, when I was already leaning in the direction of
>> > not sampling it.
>>
>> Not even to share the snark??
>
>I've grown out of that phase. I didn't watch most of "The Event" for the
>same reason - I have too high a "bullshit" detector for 'storyarced'
>Speculative Fiction now. "Flash Forward" was the last one of those that
>I'm going to sit through despite its idiocy. Those days are over for me.
>
>Perfect SF series, or Bust!!

In all fairness, Revolution is a lot more fun to bash. The stupidity
comes so fast and so often.

Anim8rFSK

9/7/2012 6:05:00 PM

0

In article
<ijball-NO_SPAM-5DDF20.08482307092012@news.eternal-september.org>,
"Ian J. Ball" <ijball-NO_SPAM@mac.invalid> wrote:

> In article <anim8rfsk-16EE80.17200606092012@news.easynews.com>,
> anim8rFSK <anim8rfsk@cox.net> wrote:
>
> > In article
> > <ijball-NO_SPAM-E33282.15143106092012@news.eternal-september.org>,
> > "Ian J. Ball" <ijball-NO_SPAM@mac.invalid> wrote:
> >
> > > In article <k2as3l$r8n$1@dont-email.me>,
> > > Robin Miller <complex.gal@invalid.com> wrote:
> > > > David wrote:
> > > >
> > > > > http://tvline.com/2012/09/05/revolution-casts-...
> > > > >
> > > > > Exclusive: Grey's Anatomy Alum Kim Raver Joins in NBC's Revolution
> > > > > by Matt Webb Mitovich
> > > > >
> > > > > NBC's Revolution drama, now viewable online but officially premiering
> > > > > Sept. 17, has recruited Grey's Anatomy alum Kim Raver for a juicy
> > > > > recurring role.
> > > >
> > > > This will be, um, met with a mixed reaction.
> > >
> > > I neither like her, [n]or particularly dislike her.
> >
> > And there's your mixed reaction.
> >
> > > I will say this, though - this does it make it slightly *less* likely
> > > that I will sample this, when I was already leaning in the direction of
> > > not sampling it.
> >
> > Not even to share the snark??
>
> I've grown out of that phase. I didn't watch most of "The Event" for the
> same reason - I have too high a "bullshit" detector for 'storyarced'
> Speculative Fiction now. "Flash Forward" was the last one of those that
> I'm going to sit through despite its idiocy. Those days are over for me.
>
> Perfect SF series, or Bust!!

Bust, I think.

Vampire Babysitter tonight though.

--
"Every time a Kardashian gets a TV show, an angel dies."