From a53b5fb147651023134c2a2182944628f31718d5 Mon Sep 17 00:00:00 2001 From: Dan Elkouby Date: Tue, 26 Feb 2019 21:10:21 +0000 Subject: [PATCH] Revert "s/regex/re/g" This reverts commit dc2eefd58110cb1a300353426a74fd8c7df86095. --- stdplugins/sed.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/stdplugins/sed.py b/stdplugins/sed.py index 11bb96a..04f7320 100644 --- a/stdplugins/sed.py +++ b/stdplugins/sed.py @@ -1,6 +1,7 @@ from collections import defaultdict, deque import re +import regex from telethon import events, utils from telethon.tl import types, functions @@ -33,7 +34,7 @@ def doit(chat_id, match, original): flags = 0 for f in fl: if f == 'i': - flags |= re.IGNORECASE + flags |= regex.IGNORECASE elif f == 'g': count = 0 else: @@ -44,7 +45,7 @@ def doit(chat_id, match, original): s = original.message if s.startswith(HEADER): s = s[len(HEADER):] - s, i = re.subn(fr, to, s, count=count, flags=flags) + s, i = regex.subn(fr, to, s, count=count, flags=flags) if i > 0: return original, s except Exception as e: