fork download
  1. import re
  2. brand_list = ['scurfa', 'seagull', 'seiko']
  3. description = """
  4. VINTAGE KING SEIKO 44-9990 Gold Medallion,Manual Winding with mod caseback.Serviced 2019.
  5. Power reserve function at 12; push-pull crown at 4
  6. Seiko NE57 auto movement with power reserve
  7. Multilayered dial with SuperLuminova BG-W9
  8. Testing for a ScURFA 42342
  9. """
  10. model_list = ['44-9990 Gold Medallion', 'NE57 auto', '42342']
  11. regular_expression = rf"(?:{'|'.join(brand_list)})(?:\s+(?:{'|'.join(model_list)}))?"
  12. print(re.findall(regular_expression, description, re.IGNORECASE))
Success #stdin #stdout 0.02s 9556KB
stdin
Standard input is empty
stdout
['SEIKO 44-9990 Gold Medallion', 'Seiko NE57 auto', 'ScURFA 42342']