Skip to content

Commit 27f7e63

Browse files
authored
add ignore case to regex (#859)
1 parent 049414e commit 27f7e63

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

python/lib/imaging.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -664,7 +664,9 @@ def look_for_matching_protocols(self, protocols_list, scan_param):
664664
matching_protocols_list = []
665665
for protocol in protocols_list:
666666
if protocol['series_description_regex']:
667-
if re.search(rf"{protocol['series_description_regex']}", scan_param['SeriesDescription']):
667+
if re.search(
668+
rf"{protocol['series_description_regex']}", scan_param['SeriesDescription'], re.IGNORECASE
669+
):
668670
matching_protocols_list.append(protocol['Scan_type'])
669671
elif self.is_scan_protocol_matching_db_protocol(protocol, scan_param):
670672
matching_protocols_list.append(protocol['Scan_type'])
@@ -793,7 +795,7 @@ def get_violations(self, checks_list, header, severity, scan_param_dict):
793795
True for v in valid_ranges if self.in_range(scan_param, v[0], v[1])]
794796
)) if valid_ranges else True
795797
passes_regex_check = bool(len([
796-
True for r in valid_regexs if re.match(r, scan_param)
798+
True for r in valid_regexs if re.match(r, scan_param, re.IGNORECASE)
797799
])) if valid_regexs else True
798800

799801
if passes_regex_check and passes_range_check:

0 commit comments

Comments
 (0)