fork download
  1. import re
  2.  
  3. conversation = ("\nAnton: I need staff ....\n"
  4. "........................\n"
  5. ".................... now\n\n"
  6. "Antor: Ok.")
  7.  
  8. pattern=r"^.*?(\b(?:need(?:ed|ing)?)\b.*(?:(?!\n[ \t]*$)\n.*)*)"
  9. second=re.findall(pattern, conversation, re.MULTILINE)
  10. print(second.group(1))
Runtime error #stdin #stdout #stderr 0.01s 27968KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
Traceback (most recent call last):
  File "./prog.py", line 10, in <module>
AttributeError: 'list' object has no attribute 'group'