1

这是字符串:

[quote="test post1"]this is a test post[/quote]

我只想检索测试 post1 值

这就是我正在做的...

[tmp test][item-param body] [/tmp]
$str1 = $Scratch->{test};
$str1 =~ m/"(.?)"/;

但它没有给出预期值:test post1

任何帮助将不胜感激。

4

1 回答 1

1
#!/usr/bin/perl;

my $str = '[quote="test post1"]this is a test post[/quote]';

if($str=~m/\"(.+)\"/) {
print $1;
}
于 2012-07-05T22:14:34.860 回答