Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
非常简单的问题,但 =()= 运算符(或运算符)让我计算正则表达式中的匹配项。这个运算符叫什么,它到底在做什么?
示例用法:
my $count_quotes =()= $csv_line =~ /\"/gi;
谢谢
FWIW,您也可以使用运算符计算引号的数量tr///:
tr///
my $count = $csv_line =~ tr/"/"/;