Until Python 3.10, you had to use alternatives like the third-party regex module (https://pypi.org/project/regex/) for possessive quantifiers. The `re` module supports possessive quantifiers from Python 3.11 version. Greedy quantifiers will match as much as possible but will backtrack to help the overall pattern to succeed. Possessive quantifiers behave like greedy but won't backtrack.
See also my "Python re(gex)?" ebook: https://github.com/learnbyexample/py_...
Sur cette page du site, vous pouvez voir la vidéo en ligne Python tip 22: possessive quantifiers durée heure minute seconde en bonne qualité , qui a été Téléchargé par l'utilisateur learnbyexample 18 janvier 2023, Partagez le lien avec vos amis et connaissances, sur youtube cette vidéo a déjà été regardée 220 fois et il a aimé 2 téléspectateurs. Bon visionnage!