strip whitespace before matching