forked from kate/uniborg
s/regex/re/g
This commit is contained in:
parent
84e3c4bef8
commit
dc2eefd581
|
@ -1,7 +1,6 @@
|
||||||
from collections import defaultdict, deque
|
from collections import defaultdict, deque
|
||||||
import re
|
import re
|
||||||
|
|
||||||
import regex
|
|
||||||
from telethon import events, utils
|
from telethon import events, utils
|
||||||
from telethon.tl import types, functions
|
from telethon.tl import types, functions
|
||||||
|
|
||||||
|
@ -34,7 +33,7 @@ def doit(chat_id, match, original):
|
||||||
flags = 0
|
flags = 0
|
||||||
for f in fl:
|
for f in fl:
|
||||||
if f == 'i':
|
if f == 'i':
|
||||||
flags |= regex.IGNORECASE
|
flags |= re.IGNORECASE
|
||||||
elif f == 'g':
|
elif f == 'g':
|
||||||
count = 0
|
count = 0
|
||||||
else:
|
else:
|
||||||
|
@ -45,7 +44,7 @@ def doit(chat_id, match, original):
|
||||||
s = original.message
|
s = original.message
|
||||||
if s.startswith(HEADER):
|
if s.startswith(HEADER):
|
||||||
s = s[len(HEADER):]
|
s = s[len(HEADER):]
|
||||||
s, i = regex.subn(fr, to, s, count=count, flags=flags)
|
s, i = re.subn(fr, to, s, count=count, flags=flags)
|
||||||
if i > 0:
|
if i > 0:
|
||||||
return original, s
|
return original, s
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
|
|
Loading…
Reference in New Issue