Win8 Strawberry 5.8.9.5 (32) Sat 12/18/2021 23:35:28 C:\@Work\Perl\monks >perl use strict; use warnings; use Data::Dump qw(dd); my $regex = qr/[#@':;><,.{}[]=!"£$%^&*()]/; # as posted pm#11139686 Possible unintended interpolation of @' in string at - line 7. # my $regex = qr/[#\@':;><,.{}[\]=!"£\$%^&*()]/; # corrected dd $regex; no warnings 'qw'; for my $c (qw/ # @ ' : ; > < , . { } [ ] = ! " £ $ % ^ & * ( ) /) { print "'$c' ", $c =~ $regex ? ' ' : 'NO', " match \n"; } ^Z qr/[#:;><,.{}[]=!"£0^&*()]/ '#' NO match '@' NO match ''' NO match ':' NO match ';' NO match '>' NO match '<' NO match ',' NO match '.' NO match '{' NO match '}' NO match '[' NO match ']' NO match '=' NO match '!' NO match '"' NO match '£' NO match '$' NO match '%' NO match '^' NO match '&' NO match '*' NO match '(' NO match ')' NO match