如何从Perl正则表达式生成所有可能的排列?

wib*_*ble 6 regex perl permutation

我知道您可以使用globAlgorithm :: 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;
}
Run Code Online (Sandbox Code Playgroud)

Sin*_*nür 6

请参见6.5节(PDF)高阶的Perl.考虑购买印刷书:这是一件艺术品.

CPAN上还有Regexp :: Genex.