Message340102
Consider re.findall(r'.{0,2}', 'abcde').
It finds 'ab', then continues where it left off to find 'cd', then 'e'.
It can also find ''; re.match(r'.*', '') does match, after all.
It could, in fact, an infinite number of ''.
And what about re.match(r'()*', '')?
What should it do? Run forever? Raise an exception?
At some point you have to make a decision as to what should happen, and the general consensus has been to match once. |
|
| Date |
User |
Action |
Args |
| 2019-04-12 19:53:42 | mrabarnett | set | recipients:
+ mrabarnett, ezio.melotti, serhiy.storchaka, Anders.Hovmöller |
| 2019-04-12 19:53:42 | mrabarnett | set | messageid: <[email protected]> |
| 2019-04-12 19:53:42 | mrabarnett | link | issue32308 messages |
| 2019-04-12 19:53:42 | mrabarnett | create | |
|