What is the regular expression pattern of below string (SQL query)?
Select col1,colo2,col3 form tablename where col1='this is a test'
It no needs to like order by distinct and etc.
Just simple select and where clause.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
This supports flexible spacing around your commas, etc.. The raw regex should look like this:
You’ll need to escape any platform-specific characters (for example, in C#,
\sneeds to be\\s.) In C#, it would look like this:@"^Select\s+(?:\w+\s*(?:(?=from\b)|,\s*))+from\s+\w+\s+where\s+\w+\s*=\s*'[^']*'$"Also, don’t forget to make your expression ignore case. In javascript it might end in
/ilike this:/select ...+/i.