Help with Regex in VB.Net

1

I'm trying to set up an expression to run in VB.Net that finds in the contents of a file the text GO . The text is always on a new line and may or may not contain spaces or tabs. I got the expression GO|\t\s\n but it identifies the word anywhere in the text ...

An example content would be:

SET ANSI_NULLS ON
GO  
SET QUOTED_IDENTIFIER ON
GO       
--Não deve pegar o GO aqui ou no final do texto mesmo que essa linha termine com GO 
--Mas deve encontrar nas linhas 2 e 4 acima e na abaixo.
GO  

Thanks in advance for the help

    
asked by anonymous 09.06.2017 / 21:18

1 answer

1

Try% of%.

The ^GO\b is to catch at the beginning of the line and ^ to limit this word.

Test here .

    
09.06.2017 / 21:23