for in URLRX finditer tweet fro to span url group res tweet prev fro p

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
for m in URLRX.finditer(tweet):
(fro, to) = m.span()
url = m.group(1)
res += tweet[prev:fro]
prev = to
for (regex, handler) in URLSOLVERS:
match = regex.match(url)
if match:
res += handler(match)
break
for (mo,mf) in MAPPERS:
mx = mo.match(url)
if mx:
res += mf(mx)
break
tweet = res + tweet[prev:]