fork(3) download
  1. import re
  2.  
  3. pattern = "world! {} "
  4. text = "hello world! this is python"
  5.  
  6. def find_variable(pattern, text):
  7. return re.findall(pattern.format(r'(\S+)'), text)[0]
  8.  
  9. print (find_variable(pattern, text))
Success #stdin #stdout 0s 23296KB
stdin
Standard input is empty
stdout
this