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

Re^2: regex question

by sauoq (Abbot)
on Oct 27, 2005 at 22:58 UTC ( [id://503495]=note: print w/replies, xml ) Need Help??


in reply to Re: regex question
in thread regex question

you also don't escape characters in a character class.

That's not very good advice. Sometimes you certainly do need to escape characters in a character class. Take the following for example:

$ perl -le '$_ = q/f!o@o#b$a%r^b&a*z/; s/[!@#$%^&*]//g; print'

-sauoq
"My two cents aren't worth a dime.";

Replies are listed 'Best First'.
Re^3: regex question
by Skeeve (Parson) on Oct 28, 2005 at 06:35 UTC
    Or, even more drastical, see the difference in these lines:
    perl -e '$_="bjzu-sbtz -abnzo-tbhze-rb zp-ebrzl- bhza-cbkze-r\n";s/[b-z]//g;print'
    vs.
    perl -e '$_="bjzu-sbtz -abnzo-tbhze-rb zp-ebrzl- bhza-cbkze-r\n";s/[b\-z]//g;print'

    s$$([},&%#}/&/]+}%&{})*;#$&&s&&$^X.($'^"%]=\&(|?*{%
    +.+=%;.#_}\&"^"-+%*).}%:##%}={~=~:.")&e&&s""`$''`"e

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others having an uproarious good time at the Monastery: (6)
As of 2024-04-23 12:16 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found