Let's say I have text (not html), that I'm pulling from a textarea. It looks like:
ALTER LOGIN [user1] DISABLE
GO
~~~~~~~~~~~~~ important stuff to keep ~~~~~~~~~~~~~~~
~~~~~~~~~~~~~ important stuff to keep ~~~~~~~~~~~~~~~
~~~~~~~~~~~~~ important stuff to keep ~~~~~~~~~~~~~~~
ALTER LOGIN [user2] DISABLE
GO
~~~~~~~~~~~~~ important stuff to keep ~~~~~~~~~~~~~~~
~~~~~~~~~~~~~ important stuff to keep ~~~~~~~~~~~~~~~
~~~~~~~~~~~~~ important stuff to keep ~~~~~~~~~~~~~~~
I'm trying to delete from ALTER to GO for each user. With replace(), I can replace from ALTER to DISABLE, but I can't quite figure out how to match all the way to GO (which is on the next line), so that it removes the whole chunk. Thoughts?