I have a bunch of regular expression, e.g. /[a-z]/. Later in my program I need to have this as /[a-z]/g,
so I need to add the ‘global’ modifier later. How can I add a modifier to an existing regular expression?
I have a bunch of regular expression, e.g. /[a-z]/ . Later in my program
Share
Use RegEx source and flags to separate the regular expression from the flags. Then create a new one with the string and set the needed flags.