From a50c06c9eb03ae97833df8cf084618536cc352be Mon Sep 17 00:00:00 2001 From: chrisr3d Date: Tue, 27 Oct 2020 10:38:45 +0100 Subject: [PATCH] chg: Turned the regexes for audiovisual works into a single one --- lists/phone_numbers/list.json | 7 +------ tools/generate_phone_numbers.py | 2 +- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/lists/phone_numbers/list.json b/lists/phone_numbers/list.json index 99170b4..f5d9541 100644 --- a/lists/phone_numbers/list.json +++ b/lists/phone_numbers/list.json @@ -1,12 +1,7 @@ { "description": "Numbers that should never be attributed.", "list": [ - "/((?:\\+|00)33?|0?)(19900)([0-9]{4})/g", - "/((?:\\+|00)33?|0?)(26191)([0-9]{4})/g", - "/((?:\\+|00)33?|0?)(35301)([0-9]{4})/g", - "/((?:\\+|00)33?|0?)(46571)([0-9]{4})/g", - "/((?:\\+|00)33?|0?)(53649)([0-9]{4})/g", - "/((?:\\+|00)33?|0?)(63998)([0-9]{4})/g", + "/((?:\\+|00)33?|0?)(19900|26191|35301|46571|53649|63998)([0-9]{4})/g", "/((?:\\+|00)33?|0?)(999)([0-9]{6})/g" ], "matching_attributes": [ diff --git a/tools/generate_phone_numbers.py b/tools/generate_phone_numbers.py index 8e9f92f..0936e3c 100644 --- a/tools/generate_phone_numbers.py +++ b/tools/generate_phone_numbers.py @@ -12,7 +12,7 @@ def generate_french_warninglist(): # Warning list for numbers dedicated to audiovisual works: starting with any of the following list prefixes = ('19900', '26191', '35301', '46571', '53649', '63998') - warninglist.extend(regex % (prefix, '4') for prefix in prefixes) + warninglist.append(regex % ('|'.join(prefixes), '4')) return warninglist