From: Robert Klemme Date: 2010-01-14T20:50:13+09:00 Subject: Re: Bug with end of string characters in regex? 2010/1/13 Jesús Gabriel y Galán : > On Wed, Jan 13, 2010 at 6:33 PM, Justin Coyne wrote: >> Looks like I've solved my own problem the \Z in ruby doesn't have the >> same semantics as it does in other languages.  There is a \z which is >> what I wanted so as expected: >> >> /\A\n\z/m.match("\n\n") => nil > > \z            end of a string > \Z            end of a string, or before newline at the end > > So, \Z allows an extra \n at the end of the string. For the reference here's the doc: http://www.geocities.jp/kosako3/oniguruma/doc/RE.txt Cheers robert -- remember.guy do |as, often| as.you_can - without end http://blog.rubybestpractices.com/