Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: Range of chars except one

by Juerd (Abbot)
on Jan 19, 2002 at 21:49 UTC ( [id://140097]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    $text =~ s/[\x00-\x09\x0b-\x1f]+//g; # + for speed
    # or
    $text =~ tr/\x00-\x09\x0b-\x1f//d; # tr/// for even more speed
    
  2. or download this
    # OLD:$text =~ s/(?!\n)[^\x00-\x1f]//g;
    $text =~ s/[^\x00-\x1f](?<!\n)//g; # (Can't use + now)
    ...
    
    # Note: it's usually better to avoid \r and \n and use
    # literals like \cM and \cJ or \015, \012 or \x0d, \x0a.
    
  3. or download this
    2;0 juerd@ouranos:~$ perl -e'undef christmas'
    Segmentation fault
    2;139 juerd@ouranos:~$
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others examining the Monastery: (6)
As of 2024-04-23 20:06 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found