Added support for RegExp.