change square-bracket stripper to non-greedy