Tell us what’s happening:
Describe your issue in detail here.
Your code so far
My code works so I don’t know why it is rejected. How might I remove whitespace rather than not select it? is that the question?
let hello = " Hello, World! ";
let wsRegex = /[\S].+\S/g; // Change this line
let result = hello.match(wsRegex); // Change this line
console.log(result);
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/112.0.0.0 Safari/537.36 Edg/112.0.1722.64
Challenge: Regular Expressions - Remove Whitespace from Start and End
Link to the challenge: