def _add_regexp_listener(dbapi_con, con_record):
 def regexp(expr, item):
  reg = re.compile(expr)
  return (reg.search(six.text_type(item)) is not None)
 dbapi_con.create_function('regexp', 2, regexp)

def _add_regexp_listener ( dbapi_con , con_record ) : def regexp ( expr , item ) : reg = re . compile ( expr ) return ( reg . search ( six . text_type ( item ) ) is not None ) dbapi_con . create_function ( 'regexp' , 2 , regexp )
add regexp function to sqlite connections .