How can I get the start and end positions of all matches using the re
module? For example given the pattern r'[a-z]'
and the string 'a1b2c3d4'
I'd want to get the positions where it finds each letter. Ideally, I'd like to get the text of the match back too.
Question&Answers:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…