Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   Ruby (http://www.velocityreviews.com/forums/f66-ruby.html)
-   -   regex does not contain - or no match (http://www.velocityreviews.com/forums/t855906-regex-does-not-contain-or-no-match.html)

Sergio Ruiz 02-17-2009 03:06 AM

regex does not contain - or no match
 
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!
--
Posted via http://www.ruby-forum.com/.


David A. Black 02-17-2009 03:12 AM

Re: regex does not contain - or no match
 
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


Sergio Ruiz 02-17-2009 03:41 AM

Re: regex does not contain - or no match
 

>
> string !~ /regex/
>
>
> David


wow!

that totally worked!

thanks SO much!

i can't believe that was so hard to find!

--
Posted via http://www.ruby-forum.com/.



All times are GMT. The time now is 10:23 PM.

Powered by vBulletin®. Copyright ©2000 - 2013, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57