diff --git a/fmf/utils.py b/fmf/utils.py index 5e269aef..078bc38e 100644 --- a/fmf/utils.py +++ b/fmf/utils.py @@ -222,6 +222,13 @@ def filter(filter, data, sensitive=True, regexp=False, name=None): tag: Tier1 | tag: Tier2 | tag: Tier3 category: Sanity, Security & tag: -destructive + Use the back slash character ``\\`` to escape the boolean + operators if you need to specify them as part of the filter + expressions:: + + tag: Tier(1\\|2) + text: Q\\&A + Note that multiple comma-separated values can be used as a syntactic sugar to shorten the filter notation:: @@ -322,7 +329,10 @@ def check_clause(clause): # E.g. clause = 'tag: A, B & tag: C & tag: -D' # Split into individual literals by dimension literals = dict() - for literal in re.split(r"\s*&\s*", clause): + + for literal in re.split(r"\s*(?