forked from HoloTech/customcmd-plugin
15 lines
303 B
Python
15 lines
303 B
Python
import re
|
|
import regex
|
|
|
|
|
|
async def resub_async(pattern, coro, string, flags=0):
|
|
result = []
|
|
last_end = 0
|
|
|
|
for match in re.finditer(pattern, string, flags=flags):
|
|
result.append(string[last_end:match.start()])
|
|
result.append(await coro(string))
|
|
last_end = match.end()
|
|
|
|
|