demerphq wrote:
> So assuming we want to add new modifiers (we kinda do) how should this
> be addressed? Both going forward and dealing with legacy code.

My first inclination is that what you want is a way to get at the underlying
structure of the regex so you can query what flags there are on it directly
rather than relying on the string.  I wave my hands in the direction of XS.

Another option is to write a parser for qr strings to do the same thing.

Or you can get sneaky.  Since what you really want is a way to say "All the
usual flags and things, plus $foo" you can compile a very simple regex and use
that to divine the default flags and their order for the version of perl being
run.  Then you can do, a subtractive diff *observe the hands waving like so*
to remove the defaults and leave only what you expect.

Reply via email to