Help with Regex in VB.Net

Asked

Viewed 26 times

1

I’m trying to mount an expression to run in VB.Net that finds in the contents of a file the text GO. Text is always on a new line and may or may not contain spaces or tabs. I’ve come to 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

1 answer

1


Tries ^GO\b.

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

Forehead here.

  • 1

    Perfect!! Thank you @Anderson Pimentel

Browser other questions tagged

You are not signed in. Login or sign up in order to post.