I need to get the CNPJ, but, ignore the match if string contains INTERESSADO
. I need to do this using only regex, can't use if condition.
I thought that this patterns will works: (?!interessado: ).* CNPJ\W+(?P<cnpj>\d+\.\d+\.\d+\s?\/\d+-\s?\d+)
RECLAMADO: FOO LTDA - CNPJ: 99.999.999/9999-99
RECLAMADO: FOO FOO LTDA - CNPJ: 99.999.999/9999-99
TERCEIRO INTERESSADO: FOO FOO
TERCEIRO INTERESSADO: FOO FOO FOO FOO - CNPJ: 99.999.999/9999-99
TERCEIRO INTERESSADO: FOO FOO IT'S A TEST - CNPJ: 99.999.999/9999-99
TERCEIRO INTERESSADO: TEST
INTERESSADO: TEST - CNPJ: 99.999.999/9999-99
In this case, my pattern match all lines, but i need only the RECLAMADO
and `INTERSSADO CNPJ's.
I'm using regex101 to test the patterns.
obs: i'm using regex .i and .s flags.