fork download
  1. import re
  2. p = re.compile(r'query(?!\s*(?:management|resolution))')
  3. test_str = "The query resolution with this query management should not get highlighted. Only this query should get highlighted.The query resolution with this query management should not get highlighted. Only this query should get highlighted."
  4. m = p.search(test_str)
  5. if m:
  6. print(m.group())
Success #stdin #stdout 0.01s 8968KB
stdin
Standard input is empty
stdout
query