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

Re^4: Regex for weird characters

by sulfericacid (Deacon)
on Sep 27, 2004 at 16:02 UTC ( #394218=note: print w/replies, xml ) Need Help??


in reply to Re^3: Regex for weird characters
in thread Regex for weird characters

Aren't you supposed to comma separate unsimilar items like that? I don't use regexes all that often but I did test the script and it worked.


"Age is nothing more than an inaccurate number bestowed upon us at birth as just another means for others to judge and classify us"

sulfericacid

Replies are listed 'Best First'.
Re^5: Regex for weird characters
by !1 (Hermit) on Sep 27, 2004 at 16:16 UTC
    No, you aren't. Thus the reason that your a-z0-9 works fine. As a contribution to the thread:
    # cat match.pl #!/usr/bin/perl -l while (<DATA>) { chomp; print "$_ " . (/[^a-z0-9!\@#\$%^&*(),.?~:;<>+ =_'"-]/ ? "contains w +eird stuff":"is fine"); } __DATA__ funky town ^-^ b* f1 top` # perl match.pl funky town is fine ^-^ is fine b* is fine f1 is fine top` contains weird stuff #
      I thought a-z0-9 was different because you're given a range of characters instead of singly adding them yourself.

      Thanks for correcting my code though.



      "Age is nothing more than an inaccurate number bestowed upon us at birth as just another means for others to judge and classify us"

      sulfericacid

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (5)
As of 2021-10-19 09:57 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My first memorable Perl project was:







    Results (76 votes). Check out past polls.

    Notices?