- or download this
use strict;
use warnings;
...
my @group2 = ('E','F','G','H');
my $string="DEAB CDGHEF";
print "Match: $1\n" while $string =~ /([@group1]{4})/g;
- or download this
local $" = '';
- or download this
my @group1 = ('A','B','C','D');
my $char_class1 = join "", @group1;
my $string="DEABCDGHEF";
print "Match: $1\n" while $string =~ /([$char_class]{4})/g;
- or download this
use strict;
use warnings;
...
local $" = '';
print "Match: $1\n" while $string =~
/([@{[@group1[0..2],@group2[2,3]]}]{5})/g;
- or download this
use strict;
use warnings;
...
my $string="DEABCDGHEF";
my $group = join '', @group1[0..2], @group2[2,3];
print "Match: $1\n" while $string =~ /([$group]{5})/g;