Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re^3: Scrubbing a string

by Roy Johnson (Monsignor)
on Aug 24, 2007 at 21:31 UTC ( #634972=note: print w/replies, xml ) Need Help??


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

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
Node Status?
node history
Node Type: note [id://634972]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (8)
As of 2021-04-16 00:04 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?