diff --git a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/regular-expressions/remove-whitespace-from-start-and-end.english.md b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/regular-expressions/remove-whitespace-from-start-and-end.english.md index e442a1955f..9d29f0a78a 100644 --- a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/regular-expressions/remove-whitespace-from-start-and-end.english.md +++ b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/regular-expressions/remove-whitespace-from-start-and-end.english.md @@ -52,6 +52,8 @@ let result = hello; // Change this line
```js -// solution required +let hello = " Hello, World! "; +let wsRegex = /^(\s+)(.+[^\s])(\s+)$/; +let result = hello.replace(wsRegex, '$2'); ```