In the " Remove Whitespace from Start and End" challenge, you must use the alternation expression | in order for the regex to work:
/^\s+|\s+$/g;
How come /^\s+\s+$/g;
without the alternation expression not work? What is the alternation expression truly doing? How is it helping match the white space at the start and end?