Fix #997: Limited support for in-pattern regex flags.