Thanks for all the responses to my question.  However, they do not solve
my problem.  As I wrote before, my intention is to do perfect matching as
in

    another_str == str

Using

    reg = Regexp.new (str)
    another_str =~ reg

will work if str is simple such as 'abcde'.  However, if it contains
Regexp special characters, such as 'abc.de' then it won't work.  What I
want is a to_regexp function that performs this automatically for me:

    reg = /abc\.de/

instead of the simplistic

    reg = /abc.de/

Should I write the String#to_regexp by myself to handle all the Regexp
special characters?

Regards,

Bill

============================================================================
Ned Konz <ned / bike-nomad.com> wrote:
: On Friday 19 October 2001 10:26 am, William Djaja Tjokroaminata wrote:

:> I could not find a function that performs the "to_regexp" utility.

: Regexp.new(str)

: -- 
: Ned Konz
: currently: Stanwood, WA
: email:     ned / bike-nomad.com
: homepage:  http://bike-nomad.com