Pre-compiled patterns retain their settings if they are interpolated

The qr// operator precompiles a regular expression and returns a reference to that compiled pattern. You can use that reference with the binding operator to perform a match, interpolate the reference into the match or substitution operators, or combine the reference with other references or literal patterns to make a larger pattern. We cover this in Chapter 9, “Regular Expression References”, but don’t emphasize what happens with regex flags when you combine patterns. Continue reading “Pre-compiled patterns retain their settings if they are interpolated”