Advertisement
go6odn28

re_example

Feb 14th, 2024
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.16 KB | None | 0 0
  1. import re
  2.  
  3. string = "a1a1a1b11b1c1cc2c2ytyty23"
  4.  
  5. pattern = r"\d+"
  6.  
  7. print(re.findall(pattern, string))
  8.  
  9. #['1', '1', '1', '11', '1', '1', '2', '2', '23']
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement