in reply to Re^2: single quotes not allowing in perl
in thread single quotes not allowing in perl
Be careful! You have lost the ~ in your match. And you need to place the - at the beginning of the character class. See this example:
use strict; use warnings; my $title = 'have ++ fun#'; if($title=~qr(^([a-zA-Z0-9 -.()%&:;,"'/]+)$)) { print "Do my work 1\n"; } if($title=~qr(^([-a-zA-Z0-9 .()%&:;,"'/]+)$)) { print "Do my work 2\n"; }
In Section
Seekers of Perl Wisdom