Hi --

On Mon, 7 Oct 2002, David Garamond wrote:

> while we're still on it, i wonder whose decision it is to remove perl's
> dual //s + //m modifiers and just adopt //s (that is, "." will match a
> newline) and treat ^ & $ line-wise regardless of the modifiers. was it
> matz's? i think this is a fine design decision, since many people have
> trouble understanding //s and //m.

All Ruby decisions are matz's, as far as I know :-)  I like this one
too, especially in conjunction with \A, \Z, \z.

> but i wonder why the chosen name is MULTILINE (//m) instead of
> SINGLELINE (//s), and moreover why doesn't ruby complain when i give an
> s modifier. this has bitten me a couple of times in the past, since i
> often use the s modifier in my perl regexes. i believe many perl
> programmers were/will be bitten by this one.

Hmmm.  I guess you could argue that making . include \n means that
matches more easily straddle multiple lines.  Also, since $ and ^
always address the string line-wise, it's sort of misleading to
describe it as treating the string as a single line.

(Slightly playing devil's advocate, but anyway.)


David

-- 
David Alan Black                      | Register for RubyConf 2002!
home: dblack / candle.superlink.net     | November 1-3
work: blackdav / shu.edu                | Seattle, WA, USA
Web:  http://pirate.shu.edu/~blackdav | http://www.rubyconf.com