Fix potential bug in regexp