added support to RegExp patterns