[C#] RegEx search for two pattern strings and cut what's between
- by gsharp
I'm trying to write a little SQL Helper. I have a query like this stored in a string:
DECLARE @V1 INT
--ignore
DECLARE @V11 INT
DECLARE @V12 INT
--endignore
DECLARE @V2 INT
--ignore
SELECT * FROM SampleTable
INNER JOIN AnotherSampleTable
......
--endignore
SELECT * From Employee ORDER BY LastName
My helper method should cut everything what's between
--ignore
and
--endignore
The result string should look like:
DECLARE @V1 INT
DECLARE @V2 INT
SELECT * From Employee ORDER BY LastName
How can achieve my result with RegEx?