How can I change a string to regular expression? Take this method for an
This method accepts one parameter as a regular expression pattern, when
I invoke this method by
it works fine. But if I invoke this method by
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?