Message377671
Arguments are evaluated first and then the results are passed to the function. That's true throughout the language.
In this instance, you can use \g<1> in the replacement string to refer to group 1:
re.sub(r'([a-z]+)', fr"\g<1>{REPLACEMENT}", 'something') |
|
Date |
User |
Action |
Args |
2020-09-29 15:35:02 | mrabarnett | set | recipients:
+ mrabarnett, paul.moore, eric.smith, tim.golden, ezio.melotti, zach.ware, steve.dower, dkreeft |
2020-09-29 15:35:02 | mrabarnett | set | messageid: <1601393702.81.0.12299781143.issue41885@roundup.psfhosted.org> |
2020-09-29 15:35:02 | mrabarnett | link | issue41885 messages |
2020-09-29 15:35:02 | mrabarnett | create | |
|