fork download
  1. import re
  2. text = 'fafsah000012fafaa'
  3. zeroRegex = re.compile(r'^([a-zA-Z]*)(0*)(\d*)([a-zA-Z]*)$')
  4. matches = zeroRegex.search(text)
  5. print(matches.groups())
Success #stdin #stdout 0.02s 9560KB
stdin
Standard input is empty
stdout
('fafsah', '0000', '12', 'fafaa')