Removing the scope did the trick!,
thank you and excellent plugin, i though scope mean ‘group these regex’ its the scope mean for file types??
thank you again
[quote=“facelessuser”]I threw this in PHP real quick.
Notice I removed the “sql” scope, because at least in PHP, the string did not scope to “sql”.
[pre=#232628] // 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
},[/pre]
You didn’t provide me with the other commands, so I reformatted the command to only call the wrap command you gave me.
[pre=#232628] {
“caption”: “Reg Replace: Wrap SQL Query”,
“command”: “reg_replace”,
“args”: {“replacements”: “wrap_sql_in_query”], “find_only”: true}
},[/pre]
It turned this:
[pre=#232628]<?
$consulta = "select consdocdeu,fechacompro from compromi where estado =‘A’ and fechacompro <= date(now()) -1 ";
?>[/pre]
To this just fine:
[pre=#232628]<?
$consulta = query("select consdocdeu,fechacompro from compromi where estado =‘A’ and fechacompro <= date(now()) -1 ");
?>[/pre]
Maybe removing the scope is all you need to do? Maybe there is something wrong with the additional commands you did not provide me with? I don’t know since you did not provide me enough information. But there is nothing wrong with the regex, and since I don’t know what syntax language you are using, I cannot be sure whether the sql scope requirement is helpful or not, but it is a hindrance in stock PHP.[/quote]