Hi,
I am using C#/.NET 3.5 to write a program that could identify particular ONE or MORE string matches in the given string and I need help in this. :-)
Example String:
SELECT * FROM Users WHERE FIRST = ?Param1? AND LAST = ?paraMETer2? HAVING MONTHLY_Salary
> ?parameterforsalary?
Requirement:
I want a list or a string array that contains Param1, paraMETer2 and parameterforsalary from above string.
Explanation:
I have a method that will return a string like the above shown in example. This string will contain one or more Parameters opening and closing ? (question marks). Now, I want to be able to identify all those parameters to do further actions.
Also, there could be whitespaces in the given string, mulitple lines etc.. (I am not sure what to do if the user forgets to type in the closing question mark for a particular parameter, probably it will then take all the rest of string as just one parameter... ). Inside ?param defintion? can be any word, digital characters etc.
I've tried few simple regex expressions but since I'ven't worked on it much, I couldn't figure it out.
Any help is greatly appreciated.
AQ78