I faced behaviour of Perl, that I can't explain:
#!/usr/bin/perl
use strict;
use warnings;
my $number = -10;
if ($number =~ /\d+/) {
print $number;
}
This prints -10
, despite the fact, that
- \d represents [0-9]
Why does it ignore minus at the beginning?