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 (Deacon) 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.\\/_%\$'(){}&!~`@#^-+$];