From: Zhao Yi Date: 2008-12-08T18:04:49+09:00 Subject: A quetion about ruby string How can I change a string to regular expression? Take this method for an example: def match(pattern) ... end This method accepts one parameter as a regular expression pattern, when I invoke this method by match(/.../) it works fine. But if I invoke this method by param="/.../" match(param) it doesn't work as expected. It seems that the string is different with the regular expression. If the pattern stored in a string variable, how can I use it? thanks. -- Posted via http://www.ruby-forum.com/.