From: "Peña, Botp" Date: 2007-09-19T12:39:49+09:00 Subject: Re: Regexp help From: Jeremy Woertink [mailto:jeremywoertink@gmail.com] # What I want to do is determine if a string includes 2 special # characters a semi-colon and a question mark. # irb(main):009:0> encoding = ";6277200301500269=?" # => ";6277200301500269=?" # irb(main):010:0> encoding.include?(%r{;\?}.to_s) # => false start simple, check if a string contains a ; or ? irb(main):095:0> encoding[/;|\?/] => ";" check if a string starts w a ; and ends with a ? irb(main):096:0> encoding[/^;.*\?$/] => ";6277200301500269=?" string[regex] returns the matched (sub)string (wc is true in ruby) otherwise it returns nil (wc is false in ruby) kind regards -botp