Skip to content

Commit 4869eb4

Browse files
Completed Task
1 parent d0f2fed commit 4869eb4

File tree

1 file changed

+4
-0
lines changed
  • Regular-Expressions/Use-Capture-Groups-to-Search-and-Replace

1 file changed

+4
-0
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
let str = "one two three";
2+
let fixRegex = /(\w+)\s(\w+)\s(\w+)/;
3+
let replaceText = "$3 $2 $1";
4+
let result = str.replace(fixRegex, replaceText);

0 commit comments

Comments
 (0)