更新时间:2022-05-20 22:38:32
看起来你的 .*
应该是 [^)]*
,即 *任意数量的不是右括号的字符.给予
It looks like your .*
should be [^)]*
, i.e. *any number of characters that are not closing parentheses. Giving
^\(log ([^)]*)\)\s*\(log ([^)]*)\)$
或者你可以用
while ( $s =~ /\(log ([^)]*)\)/g ) {
print $1, "\n";
}