handle /[/,`#]/ as sed delimeters

This commit is contained in:
jesopo 2021-02-20 18:41:40 +00:00
parent bfb34a4eb9
commit e645a32f93
2 changed files with 2 additions and 2 deletions

View file

@ -4,7 +4,7 @@
import re, traceback import re, traceback
from src import ModuleManager, utils from src import ModuleManager, utils
REGEX_SED = re.compile("^(?:(\\S+)[:,] )?s/") REGEX_SED = re.compile(r"^(?:(\S+)[:,] )?s([/,`#]).*\2")
@utils.export("channelset", @utils.export("channelset",
utils.BoolSetting("sed","Disable/Enable sed in a channel")) utils.BoolSetting("sed","Disable/Enable sed in a channel"))

View file

@ -44,7 +44,7 @@ class SedMatch(Sed):
return None return None
def _sed_split(s: str) -> typing.List[str]: def _sed_split(s: str) -> typing.List[str]:
tokens = _tokens(s, "/") tokens = _tokens(s, s[1])
if tokens and (not tokens[-1] == (len(s)-1)): if tokens and (not tokens[-1] == (len(s)-1)):
tokens.append(len(s)) tokens.append(len(s))