go format.
Fixed a bug that panic occurs when pass invalid regexp to pattern.