With this patch Regex#inspect only uses the literal syntax when all option flags can be represented. If options includes additional flags, it uses a more extensive representation based on the constructor form.
I'm not sure if the helper methods #inspect_literal and #inspect_extensive should really be exposed. I can't see any specific use case for calling them directly instead of #inspect. We could make them private and move all documentation to #inspect.
With this patch
Regex#inspect
only uses the literal syntax when all option flags can be represented. If options includes additional flags, it uses a more extensive representation based on the constructor form.I'm not sure if the helper methods
#inspect_literal
and#inspect_extensive
should really be exposed. I can't see any specific use case for calling them directly instead of#inspect
. We could make themprivate
and move all documentation to#inspect
.Resolves #14530