正则表达式检测 SQL 注入 [英] RegEx to Detect SQL Injection

查看:61
本文介绍了正则表达式检测 SQL 注入的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有可以检测字符串中 SQL 的正则表达式?有没有人有他们以前用过的东西的样本分享?

Is there a Regular Expression that can detect SQL in a string? Does anyone have a sample of something that they have used before to share?

推荐答案

不要这样做.你几乎肯定会失败.改用 PreparedStatement(或等效的).

Don't do it. You're practically guaranteed to fail. Use PreparedStatement (or its equivalent) instead.

这篇关于正则表达式检测 SQL 注入的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆