diff --git a/src/maus/models/anwendungshandbuch.py b/src/maus/models/anwendungshandbuch.py index f349d0d..243f6f2 100644 --- a/src/maus/models/anwendungshandbuch.py +++ b/src/maus/models/anwendungshandbuch.py @@ -249,13 +249,15 @@ def _check_that_nearly_all_lines_have_a_segment_group(instance, attribute, value raise ValueError(f"There is a None segment group in line {last(switches_from_no_sg_to_sg[1])}") -_data_element_pattern = re.compile(r"^\d{4}$") +_data_element_pattern = re.compile(r"^\d{4}$|^\d{5}$|^[A-Za-z]+\d{4}$") # pylint:disable=unused-argument def _check_that_line_has_either_none_or_d4_data_element(instance, attribute, value: AhbLine): """ - checks that the given line has either a None data element or a data element that matches \\d{4} + checks that the given line has either a None data element or a data element that matches + \\d{4},\\ d{5} or [A-Za-z]+\\d{4}. + AhbLine(data_element = 0001), AhbLine(data_element = 00001) or AhbLine(data_element = R0001) """ if value.data_element is None: return