Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re: How would you write this RegExp?

by BrowserUk (Patriarch)
on Jul 26, 2016 at 21:26 UTC ( [id://1168591]=note: print w/replies, xml ) Need Help??


in reply to How would you write this RegExp?

Test this:

my $re = qr[^[0-9a-zA-Z.\\/_%$'(){}&!~`@#^-]+$];; print $string !~ $re ? 1 : 0;;

With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority". I knew I was on the right track :)
In the absence of evidence, opinion is indistinguishable from prejudice.

Replies are listed 'Best First'.
Re^2: How would you write this RegExp?
by harangzsolt33 (Chaplain) on Jul 26, 2016 at 21:49 UTC

    Wow. This is awesome! Thank you very much!!!!!

    All I had to do was put a backslash before the $ sign, and it worked beautifully!

    $re = qr[^0-9a-zA-Z.\\/_%\$'(){}&!~`@#^-+$];

Log In?
Username:
Password:

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

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

    No recent polls found