Put i flag in the right place in the regular expression.