See https://github.com/ingydotnet/yaml-libyaml-pm/issues/69 and http://perlmonks.org/?node_id=1204940
ikegami suggests using re::regexp_pattern(). re is in core since perl 5.004, the function was added in perl 5.10.
When Dumping, we could look if there are any regex flags other than u, and if not, store the naked pattern, otherwise store the stringified regex. For perl 5.8, we would just go with the existing code.
See https://github.com/ingydotnet/yaml-libyaml-pm/issues/69 and http://perlmonks.org/?node_id=1204940 ikegami suggests using
re::regexp_pattern()
. re is in core since perl 5.004, the function was added in perl 5.10. When Dumping, we could look if there are any regex flags other thanu
, and if not, store the naked pattern, otherwise store the stringified regex. For perl 5.8, we would just go with the existing code.