Advertisement
Guest User

Untitled

a guest
Sep 21st, 2019
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.22 KB | None | 0 0
  1. import re
  2. line = "041234322222_041234322222_SW_0351_20190921_01"
  3. rule = r"(SW[0-9_][0-9]*)_"
  4.  
  5. res = re.search(rule, line, re.IGNORECASE)
  6.  
  7. if res:
  8.     print(res.groups()[0])
  9. else:
  10.     print("Nessun risultato trovato.")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement