From f188754bc761ea0085df0c66d20b467b1828a43d Mon Sep 17 00:00:00 2001 From: dborges Date: Tue, 11 Jul 2023 08:52:48 +0000 Subject: [PATCH] Modificar 'validation/excel_validator.py' --- validation/excel_validator.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/validation/excel_validator.py b/validation/excel_validator.py index c53ddec..59ed842 100644 --- a/validation/excel_validator.py +++ b/validation/excel_validator.py @@ -532,11 +532,11 @@ def is_valid_history(value, validation_conf=None): try: items = [i.strip() for i in value.split("<")] for i in items: - regex1 = r'^[a-zA-Z &,;.''-]+, ((19|20)\d{2})' - regex2 = r'^[a-zA-Z &,;.''-]+, [a-zA-Z &,;.''-] (19|20)\d{2}\s\([a-zA-Z &,;.''-]+\)' - regex3 = r'^[a-zA-Z &,;.''-]+\, [a-zA-Z &,;.''-]' - regex4 = r'^[a-zA-Z &,;.''-]+, (19|20)\d{2}\s\([a-zA-Z .''-,;&]+\)' - regex5 = r'^[a-zA-Z &,;.''-]+, \([a-zA-Z &,;.''-]+\) (19|20)\d{2}' + regex1 = r'^[a-zA-Z0-9 &,;.:''-]+,?\s*((19|20)\d{2})' + regex2 = r'^[a-zA-Z0-9 &,;.:''-]+,?\s*[a-zA-Z0-9 &,;.''-] (19|20)\d{2}\s\([a-zA-Z0-9 &,;.''-:]+\)' + regex3 = r'^[a-zA-Z0-9 &,;.:''-]+\,?\s*[a-zA-Z0-9 &,;.''-]' + regex4 = r'^[a-zA-Z0-9 &,;.''-]+,?\s*(19|20)\d{2}\s\([a-zA-Z0-9 .''-,;&:]+\)' + regex5 = r'^[a-zA-Z0-9 &,;.:''-]+,?\s*\([a-zA-Z0-9 &,;.''-:]+\) (19|20)\d{2}' if re.match(regex1, i): return True elif re.match(regex2, i): @@ -558,8 +558,8 @@ def is_valid_coords(value, validation_conf=None): return True try: - regex1 = r'^-?(90(\.0+)?|[1-8]?\d(\.\d+)?);-?(180(\.0+)?|((1[0-7]\d)|(\d{1,2}))(\.\d+)?)$' - regex2 = r'^-?(90(\.0+)?|[1-8]?\d(\.\d+)?);-?(180(\.0+)?|((1[0-7]\d)|(\d{1,2}))(\.\d+)?);(\d+\.\d+|\?);(\d+\.\d+|\?)$|^(\d+\.\d+|\?)$|^;$' + regex1 = r'^-?(90(\.0+)?|[1-8]?\d(\.\d+)?)(\s*;\s*-?(180(\.0+)?|((1[0-7]\d)|(\d{1,2}))(\.\d+)?))*$' + regex2 = r'^-?(90(\.0+)?|[1-8]?\d(\.\d+)?)\s*;\s*-?(180(\.0+)?|((1[0-7]\d)|(\d{1,2}))(\.\d+)?)\s*;\s*(\d+\.\d+|\?)\s*;\s*(\d+\.\d+|\?)$|^(\d+\.\d+|\?)$|^\s*;\s*$' if not re.match(regex1, value) and not re.match(regex2, value): return False