Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re: Deregex

by Arien (Pilgrim)
on Aug 30, 2002 at 23:00 UTC ( #194270=note: print w/replies, xml ) Need Help??


in reply to Deregex

You're missing a $ in my (regex) = @_. Also, you can qr// an empty string, which will break your regex.

Simplifying and enhancing a bit more results in something like:

sub deregex { my $regex = shift; my ($ops, $pat) = $regex =~ /^\(\? ([msix-]+) : (.*) \)$/x or die "Unknown qr// format"; $pat =~ s!/!\\/!g; $ops =~ s/-.*//; return "/$pat/$ops"; }

— Arien

Replies are listed 'Best First'.
Re: Re: Deregex
by Dylan (Monk) on Aug 30, 2002 at 23:36 UTC
    Oopsy. I must've removed it when I removed the $self, from it (It was a method). Thanks a lot!

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://194270]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (3)
As of 2023-05-31 03:07 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?