fork(3) download
  1. import re
  2.  
  3. s = "xaz xazx xaxsza zsxdaszdx zasxz xaaz xaaaz"
  4. pattern = r"\bx\w*z\b"
  5. print(re.findall(pattern, s))
Success #stdin #stdout 0s 23304KB
stdin
Standard input is empty
stdout
['xaz', 'xaaz', 'xaaaz']