返回()中的文本。

方法一:

sub test {
my $text = '(zdd)(autumn)(123)(456)';
while ($text =~ /\((.*?)\)/g) {
print $1, "\n";
}
}

方法二:

sub test1 {
my $text = '(zdd)(autumn)(123)(456)';
my @matches = ($text =~ /\((.*?)\)/g) ;
foreach my $match (@matches) {
print $match, "\n";
}
}

==


相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-02-20
  • 2022-12-23
  • 2021-09-21
猜你喜欢
  • 2022-12-23
  • 2022-01-29
  • 2022-12-23
  • 2022-12-23
  • 2021-08-16
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案