I\'m working on some code that needs to serialize Perl regexes, including any regex flags. Only a subset of flags are supported, so I need to detect when unsupported flags like
use Data::Dump::Streamer ':util'; my ($pattern, $flags) = regex( qr/foo/i ); print "pattern: $pattern, flags: $flags\n"; # pattern: foo, flags: i
But if you are trying to restrict more recent features, you have a lot more work to do than just checking for /u.