in reply to Breaking Up a Bracketed String
Actually, character classes as you give are used by glob, but it looks for files with those names. When you use curly-brace alternation, it doesn't require that there be files with those names.my $str1 = "ATC[TG]C[CA]"; (my $glob_pat = $str1) =~ s!\[(.*?)\]! '{' . join(',',split//,$1) . '} +'!ge; print "Pattern is $glob_pat\n"; use Data::Dumper; print Dumper([glob($glob_pat)]);
|
|---|