Simpler, but doesn't quite do what I need. I want to supply the remaining flags, once g has been removed, in the (?$flags:...) part of the expression. And I need to remove the g so that I don't get flooded with noisy console warnings about how it's being ignored.