if str ig print

1
2
3
if ($str =~ m/^[S|Q]\w+[e|y]\(\$_\w{3,4}\)/ig){
print $& . "\n";
}