更新时间:2023-02-17 22:27:28
Perl等效于
preg_match_all('/(test|data|string)/', 'testdatastring', $m)
是
@m = ("testdatastring" =~ m/(test|data|string)/g);
/g标志代表全局,因此它在列表上下文中返回匹配项列表.
The /g flag stands for global, so it returns a list of matches in list context.