in reply to Re^2: Tidying and simplifying a regular expression (flags)
in thread Tidying and simplifying a regular expression

It's about preserving the flags of the embedded regex ...

Yes, and the reason that is done is, at least in part, to make composition of relatively more complex regexes from simpler  qr// components (via interpolation) work "right."


Give a man a fish:  <%-{-{-{-<

Replies are listed 'Best First'.
Re^4: Tidying and simplifying a regular expression (interpolation)
by LanX (Saint) on Dec 10, 2017 at 22:22 UTC
    > composition of relatively more complex regexes from simpler  qr//  components (via interpolation)

    The "interpolation" part is surprising and irritating me here.

    I was somehow expecting that an already compiled simpler regex doesn't need to be stringified and interpolated again.

    But this approach is surely easier to achieve and most probably more robust.

    Cheers Rolf
    (addicted to the Perl Programming Language and ☆☆☆☆ :)
    Wikisyntax for the Monastery