From 408dfc11ed538621f23d999251911f3e66ee058f Mon Sep 17 00:00:00 2001 From: eukub Date: Sun, 24 Dec 2023 21:44:41 +0300 Subject: [PATCH] fixed regular expression to support Unicode and improve readability --- src/documents/barcodes.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/documents/barcodes.py b/src/documents/barcodes.py index 3e2b309b6..005531107 100644 --- a/src/documents/barcodes.py +++ b/src/documents/barcodes.py @@ -105,7 +105,7 @@ class BarcodeReader: asn_text = asn_text[len(settings.CONSUMER_ASN_BARCODE_PREFIX) :].strip() # remove non-numeric parts of the remaining string - asn_text = re.sub("[^0-9]", "", asn_text) + asn_text = re.sub(r"\D", "", asn_text) # now, try parsing the ASN number try: