import java.util.regex.Matcher;
import java.util.regex.Pattern;
public class Example {
public static void main(String[] args) {
final String regex = "^\"(?!FRENCH\")[^\"]*\".*(*SKIP)(*F)|(\"\")([^<>]*?)(\"\")(?=(?:[^>]*?(?:<|$)))";
final String string = "\"FRENCH\",\"11.03.2022 13:36\",\"DocumentType.APPROVAL_AV\",\"Approbation de la personne responsable du marché (\"\"RdM\"\") and (\"\"RdM\"\")\"\n"
+ "\"SPANISH\",\"11.03.2022 13:36\",\"DocumentType.APPROVAL_AV\",\"Aprobación del o de la responsable de la orden\"\n"
+ "\"ENGLISH\",\"11.03.2022 13:36\",\"DocumentType.ARGE_DECLARATION\",\"Declaration of the consortium (\"\"ARGE\"\")\"\n"
+ "\"FRENCH\",\"11.03.2022 13:36\",\"DocumentType.ARGE_DECLARATION\",\"Déclaration du groupement\"\n"
+ "\"SPANISH\",\"11.03.2022 13:36\",\"DocumentType.ARGE_DECLARATION\",\"Declaración del consorcio (en Alemania “ARGE”)\"\n"
+ "\"ENGLISH\",\"11.03.2022 13:54\",\"appHelpSignpostText\",\"If you have any technical issues, please do not hesitate to contact us personally through the following channels:<br /><br /><a href=\"\"https://test.com/\"\" target=\"\"_blank\"\">{{downloadIcon}}Guide</a> to help you enter your request.\"\n"
+ "\"FRENCH\",\"11.03.2022 13:54\",\"appHelpSignpostText\",\"Si vous rencontrez des difficultés techniques, n’hésitez pas à nous contacter personnellement via les canaux suivants : <br /><br /><a href=\"\"https://test.com/\"\" target=\"\"_blank\"\">{{downloadIcon}}Guide</a>, pour vous aider à saisir votre demande.\"\n"
+ "\"SPANISH\",\"11.03.2022 13:54\",\"appHelpSignpostText\",\"Si tiene dificultades técnicas, no dude en ponerse personalmente en contacto con nosotros o nosotras a través de los siguientes canales:<br /><br /><a href=\"\"https://test.com/\"\" target=\"\"_blank\"\">{{downloadIcon}}Guía</a>, que le servirá de ayuda para introducir su solicitud.\"\n"
+ "\"ENGLISH\",\"11.03.2022 13:36\",\"appraisalAndConsultingRadio\",\"Consulting contracts for <b>Test Service (TeS)</b>\"\n"
+ "\"FRENCH\",\"11.03.2022 13:36\",\"appraisalAndConsultingRadio\",\"Contrats de conseil pour <b>Test Service (TeS)</b>\"\n"
+ "\"ENGLISH\",\"11.03.2022 13:36\",\"argeRadio\",\"Consortium (called \"\"Arge\"\" in German)\"\n"
+ "\"FRENCH\",\"11.03.2022 13:36\",\"argeRadio\",\"Groupement momentané d’entreprises (groupement)\"\n"
+ "\"SPANISH\",\"11.03.2022 13:36\",\"appraisalAndConsultingRadio\",\"Contratos de asesoramiento para <b>Test (Tst)</b>\"\n"
+ "\"ENGLISH\",\"11.03.2022 13:54\", \"sustainabilitySignpostText\",\"The goal of sustainable management is to ensure that our earth is worth living on for future generations.<br /><br />More about GIZ’s sustainability activities can be found in the IDA communities <a href=\"\"https://test.com/\"\" target=\"\"_blank\"\">{{purIcon}}Corporate Sustainability\"\"</a> (more general) or <a href=\"\"https://test.com/\"\" target=\"\"_blank\"\">{{purIcon}}Sustainable Procurement</a> (especially for procurement). There you will find extensive information and handouts to help you make our planet a little more climate-friendly.<br /><br />And this begins not least in procurement.\"\n";
final Pattern pattern = Pattern.compile(regex, Pattern.MULTILINE);
final Matcher matcher = pattern.matcher(string);
while (matcher.find()) {
System.out.println("Full match: " + matcher.group(0));
for (int i = 1; i <= matcher.groupCount(); i++) {
System.out.println("Group " + i + ": " + matcher.group(i));
}
}
}
}
Please keep in mind that these code samples are automatically generated and are not guaranteed to work. If you find any syntax errors, feel free to submit a bug report. For a full regex reference for Java, please visit: https://docs.oracle.com/javase/7/docs/api/java/util/regex/Pattern.html