JustinF Posted February 18, 2004 Posted February 18, 2004 I need to parse a string, which contains SQL commands, for the batch terminator ("GO"). I came up with "\s[Gg][Oo]\s" which seems to work as long as there isn't a "GO" in any comments. I have no idea how to tell RegEx to ignore "GO" if it's either in a line comment (--) or within a block comment (/* */). Any RegEx gurus know how to do this? For example, the following "GO"s should be ignored select * from Customers -- go select * from Customers /* go */ select * from Customers But this should return a match: select * from Customers go select * from Customers Quote
JustinF Posted February 19, 2004 Author Posted February 19, 2004 Ok, if nobody knows how to do this, do you know of a good regex forum or something that would be able to help me? Thanks. Quote
*Gurus* Derek Stone Posted February 20, 2004 *Gurus* Posted February 20, 2004 Here's a start. (?<!--.*)go Quote Posting Guidelines
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.