regex does not contain - or no match

Discussion in 'Ruby' started by Sergio Ruiz, Feb 17, 2009.

  1. Sergio Ruiz

    Sergio Ruiz Guest

    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/.
     
    Sergio Ruiz, Feb 17, 2009
    #1
    1. Advertising

  2. 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
     
    David A. Black, Feb 17, 2009
    #2
    1. Advertising

  3. Sergio Ruiz

    Sergio Ruiz Guest


    >
    > 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/.
     
    Sergio Ruiz, Feb 17, 2009
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. hiwa
    Replies:
    0
    Views:
    648
  2. Sijo Kg
    Replies:
    17
    Views:
    397
    Jagadeesh
    Jul 15, 2009
  3. Roger Pack
    Replies:
    3
    Views:
    167
    Roger Pack
    Sep 28, 2010
  4. Dave
    Replies:
    8
    Views:
    159
    Dave Weaver
    Aug 10, 2005
  5. Jason Carlton
    Replies:
    11
    Views:
    252
    Dr J R Stockton
    Dec 8, 2009
Loading...

Share This Page