fork download
  1. import re
  2. p = re.compile(r'subject:\s*([^.]+|\S+)', re.IGNORECASE)
  3. s = "Features: -Includes hanging accessories. -Artist: William-Adolphe Bouguereau. -Made with 100pct cotton canvas. -100pct Anti-shrink pine wood bars and Epson anti-fade ultra chrome inks. -100pct Hand-made and inspected in the U.S.A. -Orientation: Horizontal. **Subject: -Figures/Nautical and beach.** Gender: -Unisex/Both. Size: -Mini 17'' and under/Small 18''-24''/Medium 25''-32''/Large 33''-40''/Oversized 41'' and above. Style: -Fine art. Color: -Blue. Country of Manufacture: -United States. Product Type: -Print of painting. Region: -Europe. Primary Art Material: -Canvas. Dimensions: -8'' H x 12'' W x 0.75'' D: 0.72 lb. -12'' H x 18'' W x 0.75'' D: 1.14 lbs. -12'' H x 18'' W x 1.5'' D: 2.45 lbs. -18'' H x 26'' W x 0.75'' D: 1.44 lbs. Paintings Prints Tori White Wildon Photography Photos Posters Abstract Black D cor Designs Framed Hazelwood Hokku Home Landscape Oil Accent 075 12 15 18 26 40 60 8 D H W x 1 1017 1824 2532 holidays, christmas gift gifts for girls boys"
  4. m = p.search(s)
  5. if m:
  6. print(m.group())
  7. print(m.group(1))
Success #stdin #stdout 0s 9024KB
stdin
Standard input is empty
stdout
Subject: -Figures/Nautical and beach
-Figures/Nautical and beach