From b2857003d9e4c60a90a1959e7283682f27fbf987 Mon Sep 17 00:00:00 2001 From: windyboy Date: Wed, 24 Jul 2024 15:20:00 +0800 Subject: [PATCH] refactor: Update ARR body parsing logic The code changes in `pattern_test.go` update the ARR body parsing logic. The message body parsing now correctly handles ARR bodies with a different pattern format. This ensures accurate extraction of data based on patterns and improves the overall functionality of the code. group of more than one alternative in fpl --- internal/config/config.go | 2 +- internal/parsers/aviation_parser.go | 2 +- internal/parsers/aviation_parser_test.go | 60 ++++++++++++++++++++++++ 3 files changed, 62 insertions(+), 2 deletions(-) diff --git a/internal/config/config.go b/internal/config/config.go index 29a756e..5eff484 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -107,7 +107,7 @@ const ( // // The regular expression uses named capture groups for each segment, allowing for easy extraction of specific information from a matched flight plan string. // fplPatternString = `\((?P[A-Z]{3})\-(?P[A-Z]+\d+)\-(?P[A-Z]{2})(.*\n)?(.*\n)?\-(?P[A-Z]+\d+\/?[A-Z]?)\s*\-(?P.*)(.*\n)?\-(?P[A-Z]{4})(?P\d{4})(.*\n)?\-(?P[A-Z]+\d+)(?P[A-Z0-9]+)\s(?P.*)(.*\n)?\-(?P[A-Z]{4})(?P\d{4})\s(?P[A-Z]{4})(.*\n)?\-(?PPBN\/[A-Z0-9]+)\s(?P