fork download
  1. import re
  2. string_1 = "Stallaresvei s 10013.pdf"
  3. regexp = r"\s([a-zA-Z.]+)\s+([0-9]+)\.pdf"
  4. m = re.search(regexp, string_1)
  5. if m:
  6. print([m.group(1), m.group(2)])
Success #stdin #stdout 0.01s 9992KB
stdin
Standard input is empty
stdout
['s', '10013']