# 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"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Deregex
by Arien (Pilgrim) on Aug 30, 2002 at 23:00 UTC | |
by Dylan (Monk) on Aug 30, 2002 at 23:36 UTC | |
|
Re: Deregex
by belg4mit (Prior) on Aug 31, 2002 at 01:10 UTC | |
by Dylan (Monk) on Aug 31, 2002 at 02:07 UTC |