James Gray
7/4/2007 4:43:00 PM
On Jul 4, 2007, at 10:51 AM, Ivan V. wrote:
> Suppose some_function() returns the string '/home/test'
I see you already have your answer, but another thing you may want to
be aware of is Regexp.escape():
def some_function; '/home/test' end
re = /#{Regexp.escape(some_function)}/ # => /\/home\/test/
re.source # => "/home/test"
James Edward Gray II