]> git.ipfire.org Git - location/libloc.git/commitdiff
location-import.in: optimise regular expression for filtering ASN allocations to...
authorPeter Müller <peter.mueller@ipfire.org>
Sun, 20 Jun 2021 10:43:07 +0000 (12:43 +0200)
committerMichael Tremer <michael.tremer@ipfire.org>
Sun, 20 Jun 2021 12:36:07 +0000 (12:36 +0000)
https://lists.ipfire.org/pipermail/location/2021-June/000394.html

Reported-by: Michael Tremer <michael.tremer@ipfire.org>
Signed-off-by: Peter Müller <peter.mueller@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/python/location-importer.in

index b235db7b19c949e262bfbeff30b2e233fd7a91f0..ff90d915b33cd3b76c55549a8866e0a93cc82762 100644 (file)
@@ -811,7 +811,7 @@ class CLI(object):
                                        continue
 
                                # Skip any AS name that appears to be a placeholder for a different RIR or entity...
-                               if re.match(r"^(ASN-BLK|)(AFCONC|AFRINIC|APNIC|ASNBLK|DNIC|LACNIC|RIPE|IANA)(\d?$|\-.*)", name):
+                               if re.match(r"^(ASN-BLK|)(AFCONC|AFRINIC|APNIC|ASNBLK|DNIC|LACNIC|RIPE|IANA)(?:\d?$|\-)", name):
                                        continue
 
                                # Bail out in case the AS name contains anything we do not expect here...