Add flags option to toRegExp method

I needed to add the global flag to the generated regexp.  Yeah, I could have done `new RegExp(set.toString(), 'g')` but this seems like something the helper method should support, so here it is. :smile: