William Djaja Tjokroaminata wrote:

> Thanks a lot for all the replies.  Based on all the inputs, I conclude
> that the solution that I sought is
> 
>     reg = Regexp.new('\A' + Regexp.escape(str) + '\z')
> 
> By the way, what is RAA?  I tried to find MakeRegExp but on the web the
> one that I found was MakeRegExp in Perl!


The Ruby Application Archive, linked to from http://www.ruby-lang.org

http://www.ruby-lang.org/en/raa.html

MakeRegEx is at
http://www.ruby-lang.org/en/raa-list.rhtml?name=MakeRegex

-- 
Ryan Tarpine, rtarpine / hotmail.com
"Things may come to those who wait, but
only the things left by those who hustle"
     -- Abraham Lincoln