From: Joseph McDonald Date: 2001-10-20T03:53:23+09:00 Subject: [ruby-talk:22788] Re: How to Convert String to Regex to Perform Exact Match WDT> will work if str is simple such as 'abcde'. However, if it contains WDT> Regexp special characters, such as 'abc.de' then it won't work. What I WDT> want is a to_regexp function that performs this automatically for me: WDT> reg = /abc\.de/ Are you looking for this: reg = Regexp.new(Regexp.escape("abc.de")) => /abc\.de/ regards, -joe