From: "RĂ¼diger Brahns" Date: 2009-07-03T17:35:09+09:00 Subject: Re: ruby (mechanize , net/http) Hello If you didn't find it yet: >> str1 = 'http://...reports/switch_accounts.html?..' => "http://...reports/switch_accounts.html?.." >> re1 = %r{/switch_accounts.html/} => /\/switch_accounts.html\// >> str1.match re1 => nil >> str2 = 'http://...reports/switch_accounts.html/?..' => "http://...reports/switch_accounts.html/?.." >> str2.match re1 => # >> re2 = %r{/switch_accounts.html\?} => /\/switch_accounts.html\?/ >> str1.match re2 => # I don't know mechanize, but str2 is an url your regex (re1) would match. re2 is the regex that matches your sample url. Regards, R.