I have a bunch of regular expressions like lower = /[a-z]/ Later in my program i need to use this as /[a-z]/g ie. i need to add the \'global\' modifier later. So how to
You can write a method for it-
RegExp.prototype.reflag= function(flags){ return RegExp(this.source, flags); }