Dear Idealists,<div>    I notice that when you do use the re module grouping, that it only tells you what it matched last:</div><div><br></div><div>Dumb Real Python Code:</div><div><div><div>>>> import re</div><div>

>>> match=re.search('^(?P<letter>[a-z])*$', 'abcz')</div></div></div><div><div>>>> match.groupdict()</div><div>{'letter': '0'}</div></div><div>What happened to all the other matches. Now here is a cool idea.</div>

<div><br></div><div>Cool Improved Python Code</div><div><div><div><div>>>> import re</div><div>>>> match=re.search('^(?P<letter>[a-z])*$', 'abcz')</div></div></div><div><div>>>> match.groupdict()</div>

<div><span class="Apple-style-span" style="font-family: 'Times New Roman'; "><span id="internal-source-marker_0.4955550937447697" style="font-family: Arial; color: rgb(0, 0, 0); background-color: transparent; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: line-through; vertical-align: baseline; white-space: pre-wrap; ">{'number': '0'}</span></span></div>
{'letter.0':'a', 'letter.1':'b', 'letter.2':'c', 'letter.3':'z'}</div><div><div><u><br></u></div>
</div></div><div><br></div><div>Now, we see all that it matched. Now the problem with this and all ideas is reverse compatibility. So an addition is also too.</div><div><div><div><div>>>> import re</div><div>>>> match=re.search('^(?P<u>P</u><number>[a-z])*<u> and also (?PP=letter.0)(?PP=letter.-1)</u>$', 'abcz<u> and also az</u>')</div>
<div>>>> match.groupdict()</div><div>{'letter.0':'a', 'letter.1':'b', 'letter.2':'c', 'letter.3':'z'}</div><div><br></div><div>Notice how I added an extra P. I also made it so that matching it in the text is also more adaptable. Please consider this idea.</div>
<div><br></div><div>Sincerely,</div><div>    Me</div>
</div></div></div>