Forum: Ruby regex does not contain - or no match

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Fddbb3cd16868f4741c2e86ef015a639?d=identicon&s=25 Sergio T. Ruiz (sergio101)
on 2009-02-17 04:06
okay, for some reason, i am not getting this.. i am feeling very
stupid..

i am trying to find a case where the regex does NOT match..

i have tried:

string !=~/regex/

but this doesn't seem to work..

anyone have any ideas how to do this?

thanks!
F53b05cdbdf561cfe141f69b421244f3?d=identicon&s=25 David A. Black (Guest)
on 2009-02-17 04:13
(Received via mailing list)
Hi --

On Tue, 17 Feb 2009, Sergio Ruiz wrote:

> okay, for some reason, i am not getting this.. i am feeling very
> stupid..
>
> i am trying to find a case where the regex does NOT match..
>
> i have tried:
>
> string !=~/regex/
>
> but this doesn't seem to work..

string !~ /regex/


David

--
David A. Black / Ruby Power and Light, LLC
Ruby/Rails consulting & training: http://www.rubypal.com
Coming in 2009: The Well-Grounded Rubyist (http://manning.com/black2)

Ruby Training Atlanta! April 1-3, http://www.entp.com/training/atlanta09
Fddbb3cd16868f4741c2e86ef015a639?d=identicon&s=25 Sergio T. Ruiz (sergio101)
on 2009-02-17 04:41
>
> string !~ /regex/
>
>
> David

wow!

that totally worked!

thanks SO much!

i can't believe that was so hard to find!
This topic is locked and can not be replied to.