enhance pattern forming. leading spaces will be ignored. close #3