1+ PN6307 DS# YQ BQ HQ KQ LQ MQ RQ QQ DQ XQ JJNPVG 1040 1215 320 0^ E
> UQ AQ EQ WQ ZQ TQ IQ JQ NQ PQ FQ CQ VQ -- T2 1:35
** Y1Q B1Q H1Q K1Q L1Q M1Q R1Q Q1Q D1Q X1Q U1Q A1Q SAV:1
13JAN16(WED) CKGZUH VIA PN DIRECT ONLY
1+ PN6263 DS# YA BA HA KA LA MA RA QA DA XA CKGZUH 0720 0920 319 0^ E
> UA AA EA WA ZA TS IS JS NS P5 FS C5 VA 2B -- 2:00
** Y1A B1A H1A K1A L1A M1A R1A Q1A D1A X1A U1A A1A SAV:1
有问题
\d(?<start>(\-)?)(?<end>(\+)?)\s+(?<share>\*)?(?<flightno>[A-Z0-9]{2}\d+)\s+()?[A-Z]{2}#()?([A-Z0-9]+)?\s(?<cabins>([A-Z][0-9A-Z]\s)+)\s+(?<deparr>([A-Z]{3}){2})\s+(?<deptime>\d{4})\s+(?<arrtime>\d{4}(\+1)?)\s+(?<flighttype>[A-Z0-9]+)\s(\d[\^|\s][A-Z]?)\s+E\s+\n[\>]\s+((?<flightno2>[A-Z0-9]{2}\d+)?(\s){0,16}(?<cabins2>([A-Z][0-9A-Z]\s)*)\s{2,}|\s*)(?<stop>([A-Z0-9\-]{2}\s)*)\s*(?<duration>\d{1,2}\:\d{1,2})\s+(\n)?(\s+\*\*\s+(?<subCabin>([A-Z][0-9][A-Z0-9]\s)+))?(?<Transit>\s+(?<share3>\*)?(?<flightno3>[A-Z0-9]{2}\d+)\s+()?[A-Z]{2}#()?([A-Z0-9]+)?\s(?<cabins3>([A-Z][0-9A-Z]\s)+)\s+(?<deparr3>([A-Z\s]{3}){2})\s+(?<deptime3>\d{4}(\+1)?)\s+(?<arrtime3>\d{4}(\+1)?)\s+(?<flighttype3>[A-Z0-9]+)\s(\d[\^|\s][A-Z]?)\s+E\s+\n[\>]\s+(?<flightno4>[A-Z0-9]{2}\d+)?(\s){0,16}(?<cabins4>([A-Z][0-9A-Z]\s)*)\s*(?<stop4>([A-Z0-9\-]{2}\s)*)\s*(?<duration3>\d{1,2})\s+\n(\s+\*\*\s+(?<subCabin3>([A-Z][0-9][A-Z0-9]\s)+))?)*
正确的
\d(?<start>(\-)?)(?<end>(\+)?)\s+(?<share>\*)?(?<flightno>[A-Z0-9]{2}\d+)\s+()?[A-Z]{2}#()?([A-Z0-9]+)?\s(?<cabins>([A-Z][0-9A-Z]\s)+)\s+(?<deparr>([A-Z]{3}){2})\s+(?<deptime>\d{4})\s+(?<arrtime>\d{4}(\+1)?)\s+(?<flighttype>[A-Z0-9]+)\s(\d[\^|\s][A-Z]?)\s+E\s+\n[\>]\s+((?<flightno2>[A-Z0-9]{2}\d+)?(\s){0,}|\s*)
原文链接:https://www.f2er.com/regex/359719.html