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 reply to Re^3: single quotes not allowing in perl
by hdb
in thread single quotes not allowing in perl
by vasanthgk91
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |