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

The tuple is not inlined. I think one problem is that the `lhs` is not considered irrefutable and an actual pattern match is generated.