Project

General

Profile

« Previous | Next » 

Revision 686

repl: All regexps are by default in multiline and ignore case mode

View differences:

bin/repl
25 25
        in_, out = row[:2]
26 26
        if in_ != '':
27 27
            if re.match(r'^\w+$', in_):
28
                in_ = r'(?i)(?<![^\W_])'+in_+r'(?![^\W_])' # match whole word
29
            repls.append((in_, out))
28
                in_ = r'(?<![^\W_])'+in_+r'(?![^\W_])' # match whole word
29
            repls.append((r'(?mi)'+in_, out))
30 30
    stream.close()
31 31
    def repl_all(str_):
32 32
        for repl, with_ in repls: str_ = re.sub(repl, with_, str_)

Also available in: Unified diff