fork download
  1. import re
  2. var1 = "abc"
  3. var2 = "def"
  4. var = 'abc1dois3quatro5def'
  5. match = re.compile('{}(.*?){}'.format(var1, var2)).search(var)
  6. if match is not None:
  7. print(match.group(1))
  8. else:
  9. print('nada encontrado em {}'.format(var))
Success #stdin #stdout 0.01s 9992KB
stdin
Standard input is empty
stdout
1dois3quatro5