Anonymously Replace string with Regex

# sion (5 months ago)

Emmmmm, pretty sorry for misleading you…

Your solution will not work if I just provide you a regex without telling you detail information, all I want is replace first and second word matched by the regex, nothing more.

# Peter Jaszkowiak (5 months ago)

All you have to do is write the regex differently:

  /(your )(\w+)( from )(\w+)/,
  (w, a, b, c, d) => `${a}${b.toUpperCase()}${c}${d.toLowerCase()}`