Skip to content
Advertisement

RegEx to Detect SQL Injection

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?

Advertisement

Answer

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

User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement