fixed global RegExp issue

#433