Tell us what’s happening:
why is this not correct but’ ```
/^\s+|\s+$/g
**Your code so far**
```javascript
let hello = " Hello, World! ";
let wsRegex = /^\s+|$s+/g; // Change this line//
let result = hello; // Change this line
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:108.0) Gecko/20100101 Firefox/108.0
Challenge: Regular Expressions - Remove Whitespace from Start and End
The first part of your regex is correct but the part after the OR will not match whitespace because of a typo.
Also, you need to change the value of the result variable, otherwise you’re simply returning the original string.
Sorry I tagged the wrong user, I think if you read carefully OP meant why you write ^something and then not $something as if ^ and $ meant that those words are at the beginning and the end.
Makes sense the question to me. The missing \ is probably known by OP or not the main issue anyways.