Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re^2: Scurbbing a string

by FunkyMonk (Bishop)
on Aug 24, 2007 at 21:09 UTC ( [id://634967]=note: print w/replies, xml ) Need Help??


in reply to Re: Scurbbing a string
in thread Scrubbing a string

I always believed that there wasn't interpolation inside a character class.

++moritz

Replies are listed 'Best First'.
Re^3: Scrubbing a string
by Roy Johnson (Monsignor) on Aug 24, 2007 at 21:31 UTC
    I would have thought the same. But you could get around it by building your RE as a string and then putting that into the s///:
    my $allowed = "pure"; my $re = "[^\Q$allowed\E]"; my $str = "p uuu+tr-ed"; $str =~ s/$re//g; print $str, "\n";

    Caution: Contents may have been coded under pressure.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others imbibing at the Monastery: (2)
As of 2026-01-16 05:29 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What's your view on AI coding assistants?





    Results (118 votes). Check out past polls.

    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.