2026-03-13 16:47:31 +01:00

12 lines
397 B
Python

import regex
class RegexCellCondition:
def __init__(self, map: dict[str, str]):
self.map = map
def check_on_row(self, row: dict[str, any]):
for apply_coll, condition in self.map.items():
entry_value = str(row.get(apply_coll).value)
if not regex.match(condition, entry_value if entry_value else ""):
return False
return True