Fixed a bug regarding to regular expressions.