update regex so as to not leave whitespace