SyntaxFix
Write A Post
Hire A Developer
Questions
Try this :
for match in re.finditer(r"\[P[^\]]*\](.*?)\[/P\]", subject): # match start: match.start() # match end (exclusive): match.end() # matched text: match.group()