G'day vsespb,
You could set up something like this just once:
my $d = qr{[0-9]}; my $w = qr{[A-Za-z0-9_]};
And then just use $w and $d instead of \w and \d. That gives you the added benefit of still having \w and \d available if you need them. Here's a minimal test:
$ perl -le ' my $w = qr{[A-Za-z0-9_]}; print q{With \x{424}:}; print 3+6 if "\x{424}" =~ /$w/; print q{With \x{42}:}; print 3+6 if "\x{42}" =~ /$w/; ' With \x{424}: With \x{42}: 9
-- Ken
In reply to Re: Force ASCII regexp for all perls 5.8+
by kcott
in thread Force ASCII regexp for all perls 5.8+
by vsespb
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |