Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import re;
- st="123456 nn1 nn2 nn3 nn4 mlm nn5 mlm"
- for search in re.finditer(r"(nn\d+)", st):
- pass
- print(search.group()) #The matched text
- print(search.start()) #The start of the matched text
- print(search.end()) #The end of the matched text
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement