fork download
  1. import re
  2. text="Phone: (111) 311-1111\nDesired Name: Friday twk-test Date of Birth: 01/01/1988"
  3. pattern=r"\bDesired Name:\s*([^\W\d_]+(?:[\s-]+[^\W\d_]+){1,2})"
  4. match = re.search(pattern, text)
  5. if match:
  6. print(match.group(1))
Success #stdin #stdout 0.03s 9644KB
stdin
Standard input is empty
stdout
Friday twk-test