[Task] add global flag to regex for multiple replacements