![]() |
|
XP is just a number | |
PerlMonks |
Deregexby Dylan (Monk) |
on Aug 30, 2002 at 22:19 UTC ( #194268=snippet: print w/replies, xml ) | Need Help?? |
# Thanks go to Arien for simplifying and enhancing :) sub deregex { my $regex = shift; my ($ops, $pat) = $regex =~ /^\(\? ([msix-]+) : (.*) \)$/x or die "Unknown qr// format"; $pat =~ s!/!\\/!g; $ops =~ s/-.*//; return "/$pat/$ops"; }
|
|