diff --git a/tabellio/searchform/cmpfunctions.py b/tabellio/searchform/cmpfunctions.py index 2f3c77a..deca707 100644 --- a/tabellio/searchform/cmpfunctions.py +++ b/tabellio/searchform/cmpfunctions.py @@ -6,15 +6,15 @@ import tabellio.config.utils def get_no_as_int(i): if i: - if ' ' in i: - try: - return int(re.match('\d+', i.strip()).group()) - except (ValueError, AttributeError): - return 99999 try: return int(i.split('-')[0]) except ValueError: - return 99999 + pass + try: + return re.findall('\d+', i)[0] + except IndexError: + pass + return 99999 return 0 class Cmp: