def is_stats_query ( query ) : if not query : return False # remove all " enclosed strings
 nq = re . sub ( r'"[^"]*"' , '' , query ) # check if there's | .... select
 if re . findall ( r'\|.*\bselect\b' , nq , re . I | re . DOTALL ) : return True return False
string is empty query python
check if the query is a normal search or select query : param query : : return :
def is_stats_query(query):
    """
    check if the query is a normal search or select query
    :param query:
    :return:
    """
    if not query:
        return False

    # remove all " enclosed strings
    nq = re.sub(r'"[^"]*"', '', query)

    # check if there's | .... select
    if re.findall(r'\|.*\bselect\b', nq, re.I|re.DOTALL):
        return True

    return False