locstats/definitions.py
def esc_regex(string):
    """Escapes non-literal regex characters in a string."""
    return string.replace('[', '\\[')\
                 .replace(']', '\\]')\
                 .replace('\\', '\\\\')\
                 .replace('^', '\\^')\
                 .replace('$', '\\$')\
                 .replace('.', '\\.')\
                 .replace('|', '\\|')\
                 .replace('?', '\\?')\
                 .replace('*', '\\*')\
                 .replace('+', '\\+')\
                 .replace('(', '\\(')\
                 .replace(')', '\\)')
Escapes non-literal regex characters in a string.
Escapes non-literal regex characters in a string.
Escapes non - literal regex characters in a string .
def esc_regex(string):
    return string.replace('[', '\\[')\
                 .replace(']', '\\]')\
                 .replace('\\', '\\\\')\
                 .replace('^', '\\^')\
                 .replace('$', '\\$')\
                 .replace('.', '\\.')\
                 .replace('|', '\\|')\
                 .replace('?', '\\?')\
                 .replace('*', '\\*')\
                 .replace('+', '\\+')\
                 .replace('(', '\\(')\
                 .replace(')', '\\)')
def esc_regex ( string ) : return string . replace ( '[' , '\\[' ) . replace ( ']' , '\\]' ) . replace ( '\\' , '\\\\' ) . replace ( '^' , '\\^' ) . replace ( '$' , '\\$' ) . replace ( '.' , '\\.' ) . replace ( '|' , '\\|' ) . replace ( '?' , '\\?' ) . replace ( '*' , '\\*' ) . replace ( '+' , '\\+' ) . replace ( '(' , '\\(' ) . replace ( ')' , '\\)' )
Escapes non-literal regex characters in a string.
Escapes non - literal regex characters in a string .
"""Escapes non-literal regex characters in a string."""
string