mirror of
https://git.proxmox.com/git/pve-common
synced 2025-08-13 23:23:55 +00:00
Tools::IPV4OCTET: move longer alternatives forward
In an alternation /a|b|c/ the first match matches, so while '1.1.1.121' matches /^$IPV4RE$/ (note the ^ and $ anchors), parsing a line like /nameserver ($IPV4RE)/ would only extract '1.1.1.12', ignoring the last '1' due to the /[1-9]/ alternative matching before the /1[0-9]/ one.
This commit is contained in:
parent
176b1186bd
commit
cd9bd2526a
@ -47,7 +47,7 @@ my $pvetaskdir = "$pvelogdir/tasks";
|
||||
mkdir $pvelogdir;
|
||||
mkdir $pvetaskdir;
|
||||
|
||||
my $IPV4OCTET = "(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9])";
|
||||
my $IPV4OCTET = "(?:25[0-5]|(?:2[0-4]|1[0-9]|[1-9])?[0-9])";
|
||||
our $IPV4RE = "(?:(?:$IPV4OCTET\\.){3}$IPV4OCTET)";
|
||||
my $IPV6H16 = "(?:[0-9a-fA-F]{1,4})";
|
||||
my $IPV6LS32 = "(?:(?:$IPV4RE|$IPV6H16:$IPV6H16))";
|
||||
|
Loading…
Reference in New Issue
Block a user