diff --git a/app/services/augmented_part_sync.py b/app/services/augmented_part_sync.py index c136f66..a1da89a 100644 --- a/app/services/augmented_part_sync.py +++ b/app/services/augmented_part_sync.py @@ -52,8 +52,10 @@ MM_PER_INCH = 25.4 # e.g. # M8-1.25 - 8mm OD, 1.25 mm pitch # M8 x 1.25 +# M50x.75 - No leading digit on floats +# Float pattern: \d*\.?\d+ _ISO_THREAD_RE = re.compile( - r"^M\s*(?P\d+(?:\.\d+)?)\s*[xX-]\s*(?P\d+(?:\.\d+)?)(?P.*)$" + r"^M\s*(?P\d*\.?\d+)\s*[xX-]\s*P?(?P\d*\.?\d+)(?P.*)$" ) # e.g. @@ -63,7 +65,7 @@ _ISO_THREAD_RE = re.compile( # # Leading digit / period, one or more digits, a dash, then _UNC_THREAD_RE = re.compile( - r"^(?P\d+(?:\.\d+)?(?:/\d+)?)\s*-\s*(?P\d+)" + r"^(?P\d*\.?\d+)\s*-\s*(?P\d*\.?\d+)" r"\s*(?PUNEF|UNC|UNF|UNS|UN)?$", re.IGNORECASE, )