import java.util.regex.Matcher;
import java.util.regex.Pattern;
public class Example {
public static void main(String[] args) {
final String regex = "Xpra(?<vcxXPRA>\\s\\d{1,2}\\/\\d{1,2}\\/\\d{1,2})\\sF:(?<vcxXPRAfreqname>\\w{1,9})\\s(?<vcxXPRAfreq>\\d{3},\\d{3})\\sTx\\((?<vcxXPRAtxPTT>\\d\\d\\d\\d)\\s(?<vcxXPRAtxPTTmin>\\d{2,4}):(?<vcxXPRAtxPTTsec>\\d{2,4})\\)\\sRx\\((?<vcxXPRArxSQ>\\d\\d\\d\\d)\\s(?<vcxXPRArxSQmin>\\d{2,4}):(?<vcxXPRArxSQsec>\\d{2,4})\\);$";
final String string = "VCX_Stat;31.07.2018 20:43:59;S;ATCC#3 V 3 0 VCX - SVS ACC Phone/vieint1044(1):366001->371701 Voc TRM:nrm.cl.clr T:0:19 CL: 42 PL: 42 CI: 0 CPT:4;\n"
+ "VCX_Stat;14.10.2018 23:40:13;S;INN#3 V 3 0 'inn2pat_1003' (4) Total: 0:29;\n"
+ "VCX_Stat;14.10.2018 23:39:57;S;ATCC#1 V 1 0 Xpra 8/1/1 F:MIL3 139,100 Tx(0000 00:00) Rx(0001 00:04);\n"
+ "VCX_Stat;14.10.2018 23:38:47;S;ATCC#2 V 2 0 VIE BRA/bravie0501:362999->999999 Voc REJ:unall.num. T:0:00 CL: 44 PL: 44 CI: 0 CPT:4;\n"
+ "VCX_Stat;14.10.2018 23:38:35;S;ATCC#1 V 1 0 VCX - SVS ACCFuKOR_/vieint1049(2):676135->661635 Voc TRM:nrm.cl.clr T:0:09 CL: 8 PL: 8 CI: 0 CPT:3;\n"
+ "VCX_Stat;14.10.2018 23:38:35;S;ATCC#1 V 1 0 INN - VIE__2MBit__/innvie1201(3):676135->661635 Voc TRM:nrm.cl.clr T:0:09 CL: 8 PL: 8 CI: 0 CPT:3;\n"
+ "VCX_Stat;14.10.2018 23:38:35;S;INN#3 V 3 0 INN2 - VOR_________/inn2vor_1005(2):676135->661635 Voc TRM:nrm.cl.clr T:0:09 CL: 8 PL: 8 CI: 0 CPT:3;\n"
+ "VCX_Stat;14.10.2018 23:38:35;S;INN#3 V 3 0 INN - VIE__2MBit__/innvie1201(3):676135->661635 Voc TRM:nrm.cl.clr T:0:09 CL: 8 PL: 8 CI: 0 CPT:3;\n"
+ "VCX_Stat;14.10.2018 23:38:23;S;INN#3 V 3 0 INN - VIE__2MBit__/innvie1201(3):676134->661634 Voc TRM:nrm.cl.clr T:0:09 CL: 8 PL: 8 CI: 0 CPT:3;\n"
+ "VCX_Stat;14.10.2018 23:38:23;S;ATCC#1 V 1 0 /Qsig2M 4/1/2(28):676134->661634 Voc TRM:nrm.cl.clr T:0:09 CL: 8 PL: 8 CI: 0 CPT:3;\n"
+ "VCX_Stat;14.10.2018 23:38:23;S;ATCC#3 V 3 0 /Qsig2M 4/1/1(28):676134->661634 Voc TRM:nrm.cl.clr T:0:09 CL: 8 PL: 8 CI: 0 CPT:3;\n"
+ "VCX_Stat;14.10.2018 23:38:23;S;ATCC#1 V 1 0 INN - VIE__2MBit__/innvie1201(3):676134->661634 Voc TRM:nrm.cl.clr T:0:09 CL: 8 PL: 8 CI: 0 CPT:3;";
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