我知道你可以使用列表生成所有排列glob http://perldoc.perl.org/functions/glob.html or 算法::置换 http://search.cpan.org/dist/Algorithm-Permute例如 - 但如何从正则表达式生成所有可能的排列?
我想做这样的事情:
@perms = permute( "/\s[A-Z][0-9][0-9]/" );
sub permute( $regex ) {
# code - put all permutations of above regex in a list
return @list;
}
See 第 6.5 节 (PDF) http://hop.perl.plover.com/book/pdf/06InfiniteStreams.pdf in 高阶 Perl http://hop.perl.plover.com/book/。考虑购买印刷书:它是一件艺术品。
还有正则表达式::Genex http://search.cpan.org/perldoc/Regexp::Genex on CPAN http://search.cpan.org/.
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)