James F. Hranicky wrote:
I had this “problem”, too. I can’t see why Ruby is so verbose on
that
and doesn’t interpret foo.gsub[!](“bar”, …) as foo.gsub[!](/bar/,
…)
automagically…The main reason I like this
line.match(‘/usr/local/lib/blah/blah/blah’)
is so I don’t have to escape forward slashes:
line.match(//usr/local/lib/blah/blah/)
I suppose writing this
line.match(Regexp.new(“/usr/local/lib/blah/blah/blah”))
works, though a touch less elegant. No biggie, though. Perhaps
there’s a
better way than that?
Don’t know if you’d consider this “better”, but there’s /another/
way…
p “foo/bar/baz”.match(%r{foo/bar})
···
On Fri, 19 Dec 2003 03:12:57 +0900 > Elias Athanasopoulos elathan@phys.uoa.gr wrote:
Do you Yahoo!?
New Yahoo! Photos - easier uploading and sharing.
http://photos.yahoo.com/