CIRCL / AIL-framework

AIL framework - Analysis Information Leak framework. Project moved to https://github.com/ail-project
https://github.com/ail-project/ail-framework
GNU Affero General Public License v3.0
1.3k stars 282 forks source link

Phone.py regex var define twice #550

Closed osagit closed 1 year ago

osagit commented 3 years ago

In Phone.py line 26-27, var reg_phone is defined twice

    # regex to find phone numbers, may raise many false positives (shalt thou seek optimization, upgrading is required)
    reg_phone = re.compile(r'(\+\d{1,4}(\(\d\))?\d?|0\d?)(\d{6,8}|([-/\. ]{1}\d{2,3}){3,4})')
    reg_phone = re.compile(r'(\+\d{1,4}(\(\d\))?\d?|0\d?)(\d{6,8}|([-/\. ]{1}\(?\d{2,4}\)?){3,4})')

2nd assignment is applied but what about the first one ? line should be deleted ?

An improve could be to use the phonenumbers lib which is a port of the Google's common Java libphonenumbers

Terrtia commented 1 year ago

Thanks for the suggestion !

The Phone module has been updated to use the phonenumbers library.