echance tests for exclude pattern. fix trailing space problem for exclude pattern