import java.util.*;
import java.lang.*;
import java.io.*;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
class Ideone{
String input
= "201700000000111 01/02/2017 11.111.111/0001-74 ADAMA BRASIL S/A ATIVA 0,00 160,00 160,00 0,00 0,00 0,00 0,00 0,00" + "201700000000122 01/02/2017 22.222.222/0002-75 AGRITEX COMERCIAL AGRÍCOLA LTDA (QUERÊNCIA) ATIVA 2,79 170,00 170,00 0,00 0,00 0,00 4,74 0,00"
+ "201700000000133 07/02/2017 33.333.333/0001-76 CREMONESE WANDSCHEER & CIA LTDA - ME ATIVA 0,00 50,00 50,00 0,00 0,00 0,00 0,00 0,00"
+ "201700000000204 23/02/2017 23.972.199/0001-15 G3 SEMENTES LTDA ATIVA 0,00 230,00 230,00 0,00 0,00 0,00 0,00 0,00";
String regex
= "\\b(\\d{2}\\.\\d{3}\\.\\d{3}\\/\\d{4}\\-\\d{2})\\b([A-zÀ-ú-1-9\\s\\\\\\/&\\-\\(|)]{5,}.*[a-zA-Z])\\b"; Pattern pattern = Pattern.compile(regex);
Matcher matcher = pattern.matcher(input);
while (matcher.find()) {
String cnpj
= matcher.
group(1).
trim(); String nome
= matcher.
group(2).
trim(); }
}
}
aW1wb3J0IGphdmEudXRpbC4qOwppbXBvcnQgamF2YS5sYW5nLio7CmltcG9ydCBqYXZhLmlvLio7CmltcG9ydCBqYXZhLnV0aWwucmVnZXguTWF0Y2hlcjsKaW1wb3J0IGphdmEudXRpbC5yZWdleC5QYXR0ZXJuOwoKY2xhc3MgSWRlb25lewoJcHVibGljIHN0YXRpYyB2b2lkIG1haW4gKFN0cmluZ1tdIGFyZ3MpIHRocm93cyBqYXZhLmxhbmcuRXhjZXB0aW9uewoJCVN0cmluZyBpbnB1dCA9ICIyMDE3MDAwMDAwMDAxMTEgMDEvMDIvMjAxNyAxMS4xMTEuMTExLzAwMDEtNzQgQURBTUEgQlJBU0lMIFMvQSBBVElWQSAwLDAwIDE2MCwwMCAxNjAsMDAgMCwwMCAwLDAwI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