Regular expression question - using 'not' logic with it

I know this is probably so easy, but I just can't find any documentation
on it because it is not character class value.

If 4 specific values exists, I do not want to output anything. How can I
check that these values do not exist, otherwise output?

if overrideVal1 != /Stamp/ or overrideVal2 != /Create/ or overrideVal3
!= /6400/ or overrideVal4 != /5400000/ then
  puts "No results"
else
  #call method to output results
  getValues()
end

···

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

It's not clear to me how many strings you have to check, but if you
want to see if
a string doesn't match four possibilities in a regular expression this
is one way:

irb(main):001:0> a = "abcde"
=> "abcde"
irb(main):004:0> a !~ /Stamp|Create|6400|5400000/
=> true
irb(main):005:0> a = "TimeStamp"
=> "TimeStamp"
irb(main):006:0> a !~ /Stamp|Create|6400|5400000/
=> false

Jesus.

···

On Thu, Jan 8, 2009 at 4:11 PM, Mmcolli00 Mom <mmc_collins@yahoo.com> wrote:

I know this is probably so easy, but I just can't find any documentation
on it because it is not character class value.

If 4 specific values exists, I do not want to output anything. How can I
check that these values do not exist, otherwise output?

if overrideVal1 != /Stamp/ or overrideVal2 != /Create/ or overrideVal3
!= /6400/ or overrideVal4 != /5400000/ then
puts "No results"
else
#call method to output results
getValues()
end

Thanks!

···

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