http://www.ex-parrot.com/pdw/Mail-RFC822-Address.html
\w
\W
\s
matching against a url with or without 'www.'
http://rubular.com/r/YS5dAgYaDW
http://rubular.com/r/NdUkySPpdg
stub_request(:get, /https:\/\/mbc-test-rates\.herokuapp\.com\/calculate-premium\?action=premium_and_commission&controller=contract_bonds&t=.*/)
stub_request(:get, %r|https://mbc-test-rates\.herokuapp\.com/calculate-premium\?action=premium_and_commission&controller=contract_bonds&t=.*|)
to_return(:status => 404, :body => body, :headers => {})
%s;\(\w*\) => ;\1 ;g
"That rug really tied the room together." =~ /room/
=> character position of the first matching character
"That rug really tied the ".length
/room/ !~ "That rug really tied the room together."
=> false
string = "We believe in nothing, Lebowski!"
m = /(.*)believe(.*)/.match(string)
m.captures
=> an array with all your captures
m[0] OR m.to_s
=> full string that matches
m[1]
=> first match
m[2]
=> next match
http://rubular.com/r/Kaj8mPEA4c
/believe/ =~ "We Believe in nothing, Lebowski!"
=> nil
/believe/i =~ "We Believe in nothing, Lebowski!"
=> nil