Advertisement
Guest User

Untitled

a guest
Sep 17th, 2014
998
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.25 KB | None | 0 0
  1. import re;
  2.  
  3. st="123456 nn1 nn2 nn3 nn4 mlm nn5 mlm"
  4.  
  5. for search in re.finditer(r"(nn\d+)", st):
  6.     pass
  7.  
  8. print(search.group()) #The matched text
  9. print(search.start()) #The start of the matched text
  10. print(search.end()) #The end of the matched text
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement