regexp matching bug fixed