<bobthecow>
guardian: because that's what it means (meant)
<bobthecow>
foo/* == /foo\/.*?/
<bobthecow>
4.x changes that though.
<bobthecow>
guardian: from the ruby style guide:
<bobthecow>
Use %r only for regular expressions matching more than one '/' character.
<bobthecow>
Prefer () as delimiters for all % literals, except %r. Since braces often appear inside regular expressions in many scenarios a less common character like { might be a better choice for a delimiter, depending on the regexp's content.
<bobthecow>
... so based on those two rules, if it has more than one /, use %r{}
<bobthecow>
if it has zero or one slash, use //
<guardian>
bobthecow: ? is redundant with the star operator
<guardian>
.*? == .* right?
<bobthecow>
no, that's the greediness modifier.
<bobthecow>
.*? == "as few . as possible"
<guardian>
oh ok
<guardian>
overlooked that
<bobthecow>
that way you can match /foo/*/bar/
<bobthecow>
otherwise the .* replacement would eat /bar/ and nothing would match.
<bobthecow>
or rather, it would match in unpredictable ways.
<guardian>
thx
fullbit has quit [Quit: Leaving.]
prxq has joined #nanoc
<ddfreyne>
guardian: %r{} is quite nice, because it doesn’t requir you to escape /
cDlm has quit [Ping timeout: 265 seconds]
alerante has quit [Remote host closed the connection]