fork download
  1. import re
  2. rx = r"""^(``|,,|")((?:(?!"|'{2}|`{2}|,{2}).)*)(''|``|")$"""
  3. texts = ["``Some question is here ,some text here''", "``Some question is here ,,some text here''"]
  4. for text in texts:
  5. m = re.search(rx, text)
  6. if m:
  7. print(f"MATCHED: {text}")
  8.  
  9.  
Success #stdin #stdout 0.03s 9628KB
stdin
Standard input is empty
stdout
MATCHED: ``Some question is here ,some text here''