| Refresh | Home EGTry.com

perl many ways of quotes



my $value1=q|'this is "html" attribute value
could be in multiple line' b="2">|;
my $value2=q|"this is 'html' attribute value
could be in multiple line" b="2">|;

if ($value1=~ /^(.)(.*)\1/s) {
 print "single quote: $1\n";  
 print "content: $2\n";
}

if ($value2=~ /^(.)(.*?)\1/s) {
 print "single quote: $1\n";  
 print "content: $2\n";
}