curriculum/challenges/english/blocks/regular-expressions/587d7dbb367417b2b2512bac.md
Sometimes whitespace characters around strings are not wanted but are there. Typical processing of strings is to remove the whitespace at the start and end of it.
Write a regex and use the appropriate string methods to remove whitespace at the beginning and end of strings.
Note: The String.prototype.trim() method would work here, but you'll need to complete this challenge using regular expressions.
result should be equal to the string Hello, World!
assert(result === 'Hello, World!');
Your solution should not use the String.prototype.trim() method.
assert(!__helpers.removeJSComments(code).match(/\.?[\s\S]*?trim/));
The result variable should not directly be set to a string
assert(!__helpers.removeJSComments(code).match(/result\s*=\s*["'`].*?["'`]/));
The value of the hello variable should not be changed.
assert(hello === ' Hello, World! ');
let hello = " Hello, World! ";
let wsRegex = /change/; // Change this line
let result = hello; // Change this line
let hello = " Hello, World! ";
let wsRegex = /^(\s+)(.+[^\s])(\s+)$/;
let result = hello.replace(wsRegex, '$2');