string.sub looks like it only replaces the first instance. Is there an option for that or another method that can replace all patterns? Can you do it inside a regex like perl?
(I think something like r/blah/blah/)
… and +1 to anyone who can tell me WHY ON EARTH does string.sub replace just the FIRST match?
String.gsub should do the trick.
Quoting docs: