I am not sure about that.
It is perfectly allowed to use a character class Perl short-cut within brackets, [\d] means the same as [0-9]
[\w] would mean same as [a-zA-Z0-9_]
use strict;
use warnings;
my $x = 'a34x5';
my @y = $x =~ /([\d]+)/g;
my @z = $x =~ /([0-9]+)/g;
print "@y\n"; # 34 5 \d worked fine
print "@z\n"; # 34 5
my @b = $x =~ /([\d\w]+)/g;
print "@b\n"; # a34x5 \d irrelevant but \w works
my @c = $x =~ /([\w]+)/g; #brackets not needed
print "@c\n"; #a34x5
my @d = $x =~ /(\w+)/g;
print "@d\n"; #a34x5
No matter what, the OP's code is bizarre.
Added: The idea of using an anchor to the beginning of the string, followed by any amount of random stuff, makes no sense to me. Better to leave that off entirely (don't put /^.*(match)/, just put /(match)/.
I think if you want \ in the character set, you have to escape it with another \
|