Text matching (logic)#

and#

class daf.logic.and_(*args, operands: List[BaseLogic] = [])#

Represents logical AND operator.

Parameters:

args (Unpack[BaseLogic]) – Arbitrary number of operands (either logic boolean or text operands).

or#

class daf.logic.or_(*args, operands: List[BaseLogic] = [])#

Represents logical OR operator.

Parameters:

args (Unpack[BaseLogic]) – Arbitrary number of operands (either logic boolean or text operands).

not#

class daf.logic.not_(operand: BaseLogic)#

Represents logical NOT operator.

Parameters:

operand (BaseLogic) – A single operand to negate.

contains#

class daf.logic.contains(keyword: str)#

Text matching condition.

Parameters:

keyword (str) – The keyword needed to be inside a text message.

regex#

class daf.logic.regex(pattern: str, flags: RegexFlag = RegexFlag.MULTILINE, full_match: bool = False)#

RegEx (regular expression) text matching condition.

Parameters:
  • pattern (str) – The RegEx pattern string.

  • flags (Optional[re.RegexFlag]) – RegEx (binary) flags. Defaults to re.MULTILINE.

  • full_match (Optional[bool]) – Boolean parameter. If True, the pattern must capture the entire text message string for a match. Defaults to False.