There's more than one way to do things | |
PerlMonks |
Re^4: YAML::XS perl/regexp (?u:(?u:by tinita (Parson) |
on Dec 19, 2017 at 21:17 UTC ( [id://1205874]=note: print w/replies, xml ) | Need Help?? |
Another possibility would be to continue just using a string. Check with regexp_pattern(), if there are any flags (ignoring u), just store the stringified regex, otherwise store the pattern itself.
This would still lead to unnecessary (?:...) but it wouldn't grow in roundtrips.
Have been looking into universal.c how regexp_pattern() is implemented. At the moment it's too much magic for me to understand.
In Section
Seekers of Perl Wisdom
|
|