Tell us what’s happening:
Your code so far
let str = "one two three";
let fixRegex = /(\w+)\s(w+)\s(w+)/g; // Change this line
let replaceText = "$3 $2 $1"; // Change this line
let result = str.replace(fixRegex, replaceText);
console.log(result)
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 6.1; ) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.116 Safari/537.36
.
Challenge: Use Capture Groups to Search and Replace
Link to the challenge: