How is this different from trim? Looking at the trim docs on MDN, they suggest almost the same regex (`/^\s+|\s+$/g`). Not sure how this would address the issue of spaces.