Quantcast
Channel: .NET Framework Class Libraries forum
Viewing all articles
Browse latest Browse all 8156

Help with following REGEX, how to ignore GOTO, but match GO

$
0
0

Hi,

I have the following Regular expression for helping to parse TSQL scripts.

System.Text.RegularExpressions.Regex r = new System.Text.RegularExpressions.Regex(@"^(\s|\t)*go(\s\t)?.*",
              System.Text.RegularExpressions.RegexOptions.Multiline | System.Text.RegularExpressions.RegexOptions.IgnoreCase);

My issue is that if a SCRIPT contains GOTO it sees this as GO and makes a match which I would like to be ignored.  How can I match GO, but ignore GOTO?

Thanks!


Viewing all articles
Browse latest Browse all 8156


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>