Paste Search Dynamic
expr Match
  1. import re
  2.  
  3. expr = r"bSuper(?P<sp>[s.-_])+Bowl(?P=sp)+(?P<game_number>(d+))b"
  4. folder = "Super.bowl 23"
  5.  
  6. p = re.compile(expr, re.IGNORECASE)
  7. m = p.search(folder)
  8.  
  9. if m:
  10.         print(m.string[m.start():m.end()])
  11. else:
  12.         print("Match not found.")
Parsed in 0.008 seconds