I trying to write a pattern to get each CPNJ group inside a this block of text, but the condition is that, is needed starts with executados: and ends with a CNPJ group. But, my pattern always get the last group, I don't know what I should do for it's works.
The answer getting specific groups of patterns inside a block text does not works!
pattern: (?:executados\:)[\p{L}\s\D\d]+CNPJ\W+(?P<cnpj>\d+\.\d+\.\d+\/\d+-\d+)
string to test:
Dados dos executados:
1. FOO TEST STRING LTDA., CNPJ: 88.888.888/8888-88,
2. ANOTHER TEST STRING LTDA LTDA LTDA - ME, CNPJ: 99.999.999/9999-99,
3. FOO TEST STRING LTDA., CPF: 999.999.999-99,
4. FOO TEST STRING LTDA., CPF: 999.999.999-99.
Como medida de economia e celeridade processuais, atribuo a
I would to get the values {'cnpj': ['88.888.888/8888-88', '99.999.999/9999-99']}, this way is getting just the last.

executados:text[text.index("executados:"):])?