Hi, I hope ‘facelessuser’ can answer me this:
i’m trying to use this snippet:
// busca consultas SQL y las encierra en query("consulta")
"wrap_sql_in_query": {
"scope": "sql",
"find" : "((\"|')(delete|select|insert|update)\\s+\\w\\s=,.'\\$;\\(\\)+-<>|]+(\"|'))",
"replace": "query(\\1)",
"greedy_replace": true,
"case" : false
},
I have that in /home/user/.config/sublime-text-2/Packages/RegReplace/reg_replace.sublime-settings
in /home/user/.config/sublime-text-2/Packages/RegReplace/Default.sublime-commands
i have:
{
"caption": "Reg Replace: Update PG to ADODB",
"command": "reg_replace",
"args": {"replacements": "wrap_sql_in_query", "update_pg_to_adodb", "update_pg_to_adodb1", "update_pg_result", "comment_pg_exec"], "find_only": true}
},
but no results are highlighted, i tested the regex in both pythex.org/ and it worked fine (removing the escape )
the test case is:
$consulta = "select consdocdeu,fechacompro from compromi where estado ='A' and fechacompro <= date(now()) -1 ";
and the expected result is:
$consulta = query("select consdocdeu,fechacompro from compromi where estado ='A' and fechacompro <= date(now()) -1 ");
is like the backslashes aren’t working, but if i remove the backslashes sublime tells:
thank you!