fork download
  1. import re
  2. file = "sqlite3ErrorMsg(pParse, variable); \n sqlite3ErrorMsg(pParse, \"row value misused\");\n ){\n sqlite3ErrorMsg(pParse, \"no \\\"such\\\" function: %.*s\", nId, zId);\n pNC->nErr++;\n }else if( wrong_num_args ){\n sqlite3ErrorMsg(pParse,\"wrong number of arguments to function %.*s()\",\n nId, zId);\n pNC->nErr++;\n }\n if( pExpr->iTable<0 ){\n sqlite3ErrorMsg(pParse,\n \"second argument to likelihood must be a \"\n \"constant between 0.0 and 1.0\");\n pNC->nErr++;\n }\n }else if( wrong_num_args ){\n sqlite3ErrorMsg(pParse,\"factory must return a cursor, not \\\\w+\", \n nId);\n pNC->nErr++;"
  3. rx = r'(?:sqlite3ErrorMsg|sqlite3MPrintf|sqlite3VdbeError)\s*\(\s*\w+,((?:\s*"[^"\\]*(?:\\.[^"\\]*)*")+)'
  4. matches = [" ".join(map(lambda x: x.strip(' "'), m.strip().splitlines())) for m in re.findall(rx, file)]
  5. print(matches)
Success #stdin #stdout 0.02s 9628KB
stdin
Standard input is empty
stdout
['row value misused', 'no \\"such\\" function: %.*s', 'wrong number of arguments to function %.*s()', 'second argument to likelihood must be a constant between 0.0 and 1.0', 'factory must return a cursor, not \\\\w+']