是否有Perl相当于Python的re.findall / re.finditer(迭代正则表达式结果)?

前端之家收集整理的这篇文章主要介绍了是否有Perl相当于Python的re.findall / re.finditer(迭代正则表达式结果)?前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
在Python中编译的正则表达式模式 have a findall method执行以下操作:

Return all non-overlapping matches of
pattern in string,as a list of
strings. The string is scanned
left-to-right,and matches are
returned in the order found. If one or
more groups are present in the
pattern,return a list of groups; this
will be a list of tuples if the
pattern has more than one group. Empty
matches are included in the result
unless they touch the beginning of
another match.

在Perl中执行此操作的规范方法是什么?我能想到的一个天真的算法是“当搜索并用空字符串替换成功时,做[套件]”.我希望有一个更好的方式. 原文链接:https://www.f2er.com/Perl/172863.html

猜你在找的Perl相关文章