Added support for regular expressions

Replaced text match with regexp match