J
JP
Guys, maybe you can help.
I have a method that basically parses any string sent to it to ensure
patterns that could be interpreted as a possible SQL injection do not exists
before send the data to the database. One of the requirements is that it must
look for any of the common words for SQL - UPDATE, INSERT, DELETE, etc and
remove them. Now I need it to keep the words in the string, but check to make
sure there are no spaces after the potential command
SELECT [unknown number of spaces after the 'SELECT' need to be removed while
maintaining any other words that follow
ie: SELECT [unknown spaces] the number of cards would now become
SELECT|the number of cards
I need a RegEx pattern in C# 1.1 that can look for key words containing AT
LEAST ONE space after they key word and only the keyword and any following
spaces with the pipe character.
I have my pattern started, but I cannot seem to figure how to only apply
this particular case above. Maybe Im just having a brain drain I dont know,
but I cant get it to work. Some how I need a veriable in the expression
Regex expression = new Regex(@"^\s*(.*?)\s*$", "$1");
I have a method that basically parses any string sent to it to ensure
patterns that could be interpreted as a possible SQL injection do not exists
before send the data to the database. One of the requirements is that it must
look for any of the common words for SQL - UPDATE, INSERT, DELETE, etc and
remove them. Now I need it to keep the words in the string, but check to make
sure there are no spaces after the potential command
SELECT [unknown number of spaces after the 'SELECT' need to be removed while
maintaining any other words that follow
ie: SELECT [unknown spaces] the number of cards would now become
SELECT|the number of cards
I need a RegEx pattern in C# 1.1 that can look for key words containing AT
LEAST ONE space after they key word and only the keyword and any following
spaces with the pipe character.
I have my pattern started, but I cannot seem to figure how to only apply
this particular case above. Maybe Im just having a brain drain I dont know,
but I cant get it to work. Some how I need a veriable in the expression
Regex expression = new Regex(@"^\s*(.*?)\s*$", "$1");