Add missing /g flag to regular expression