ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> ruby-talk
ruby-talk
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

Privacy Policy | Email Opt-out | Feedback | Syndication
© 2004 ActiveState, a division of Sophos All rights reserved