Fixed issue with strings as regex.