Re: Doing an AND in regexp char class
by Joel VanderWerf other posts by this author
May 8 2008 5:59PM messages near this date
Re: Doing an AND in regexp char class
|
Re: Doing an AND in regexp char class
David A. Black wrote:
> > irb(main):013:0> /(?=.*h)(?=.*o)/ === "h o"
> > => true
>
> That depends on the order, though.
Yes, it's buggy. Should use //m:
irb(main):003:0> /(?=.*h)(?=.*o)/ === "o \nh"
=> false
irb(main):004:0> /(?=.*h)(?=.*o)/m === "o \nh"
=> true
Does that fix the order problem you were thinking of?
--
vjoel : Joel VanderWerf : path berkeley edu : 510 665 3407
Thread:
Todd Benson
Rick DeNatale
Ara.T.Howard
Pit Capitain
Todd Benson
Joel VanderWerf
7stud --
David A. Black
7stud --
Todd Benson
David A. Black
Joel VanderWerf
Todd Benson
David A. Black
Joel VanderWerf
David A. Black
Ara.T.Howard
Robert Dober
|