Trim leading and trailing whitespace on match