Jeremy Woertink wrote:
> What I want to do is determine if a string includes 2 special characters
> a semi-colon and a question mark.

You don't need regular expressions to do that, try this instead:

irb> encoding.include? ";" and encoding.include? "?"
  => true

On the other hand, if you want to use regular expressions regardless, 
you should notice that String#include? takes a string rather than a 
Regexp.

Note that:
irb> %r{;\?}.to_s
   > "(?-mix:;\\?)"

So
encoding.include?(%r{;\?}.to_s)

is equivalent to
encoding.include?("(?-mix:;\\?)")

which is not going to succeed.

To use a regexp, try:
irb> encoding =~ /(;.*\?)|(\?.*;)/
  => true.

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