From: James Edward Gray II Date: 2010-06-04T23:25:18+09:00 Subject: [ruby-core:30586] Re: [Bug #3388] regexp support for start_with? and end_with? On Jun 4, 2010, at 5:24 AM, Thomas Sawyer wrote: > But #end_with? is more difficult, and I had to use regular expressions. > > def end_with?(suffix) > suffix = Regexp.escape(suffix) if String===suffix > /#{suffix}$/.match(self) ? true : false > end $ does not mean the end of the data in a regular expression. It means the end of the line. \z would be more correct. James Edward Gray II