Added support for stronger regular expressions

Hi,

I modified additional methods to support for stronger regular expressions. The current 'pattern' method in upstream does not support i, m, g modifiers while these are standard and commonly used. Also, the current method adds ^ $ metachars to its input RE if the the supplied RE has the type of string which is a wrong assumption. I improved the method to address these issues.