Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/regex/19.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 需要验证sql查询的java脚本函数,它不应该允许像alter、update、delete这样的dml_Javascript_Regex - Fatal编程技术网

Javascript 需要验证sql查询的java脚本函数,它不应该允许像alter、update、delete这样的dml

Javascript 需要验证sql查询的java脚本函数,它不应该允许像alter、update、delete这样的dml,javascript,regex,Javascript,Regex,javascript正则表达式验证sql查询从emp中选择*。 如果sql查询字符串具有类似于delete、update、drop、insert等DML,则应返回false。您可以使用以下命令: /^(?!delete|update|drop|insert).*/gi JS代码: /^(?!delete|update|drop|insert).*/gi.test(myString)

javascript正则表达式验证sql查询从emp中选择*。
如果sql查询字符串具有类似于delete、update、drop、insert等DML,则应返回false。您可以使用以下命令:

/^(?!delete|update|drop|insert).*/gi
JS代码:

/^(?!delete|update|drop|insert).*/gi.test(myString)