I am having some trouble with a regular expression (don't know if what I want to do is possible.)
Scenario:
I have an input area where users can write some text. They would like to be able to also execute some SQL query where the result is then going to be displayed in the text, when the text is sent to a customer in an email.
Rough example:
#
Hi
I have attached the invoice SQL(SELECT DocNumber FROM X WHERE DocEntry IN (SELECT DocEntry FROM X););
Please provide payment for the invoice.
Regards
#
I am having some difficulties handling that the users can write () and ; in SQL.
Have anyone done something like this before with regex or am I going to do have to do some ugly split, substring and last index of in C#?
Any comments/suggestions would be much appreciated.
SQL(...);then use brace matching to find the end. (iterate through adding and subtracting when you hit a brace, until the count returns to zero.drop table X;instead?