rearrange regex ignore pattern