$search_buffer="this text has teststring in it, it has a Test String too";
@waitfor=('Test string','some other string');
foreach my $test (@waitfor)
{
eval ('if (lc $search_buffer =~ lc ' . $test . ') ' .
'{' .
' $prematch = $`;' .
' $match = $&; ' .
' $postmatch = ' . "\$';" .
'}');
print "prematch=$prematch\n";
print "match=$match\n"; #I want to match both "teststring" and "Test String"
print "postmatch=$postmatch\n";
}
我需要打印测试字符串和测试字符串,你能帮忙吗?谢谢。