in reply to Re^2: Counting characters within regexp
in thread Counting characters within regexp

Here is how to use a character class to achieve that.

use strict; use warnings; use Test::More; my @good = ( 'a', '9', '_', ); my @bad = ( '-', '$', '?', ); my $re = qr/[\w.]/; plan tests => @good + @bad; like $_, $re, "match for '$_'" for @good; unlike $_, $re, "no match for '$_'" for @bad;

🦛