I am using Regex.Split to split a SQL script on the keyword "GO". My problem here is that I cannot seem to get my head around how to get the Regex to do the split. My regex expression also splits on "GO" even if it's in a SQL statement like:
Insert into x(a,b) values(‘please go get some text’,’abc’)
But I only want it to split on the keyword "GO". Any suggestions?
EDIT: I am using c#. at the moment my regex is simply:
foreach (string batch in Regex.Split(script, "\\bGO\\b", RegexOptions.IgnoreCase))
{
yield return batch;
}