refactor: Update CNL pattern in config.go

The code changes in `config.go` update the CNL pattern to correctly match CNL messages. This update ensures accurate extraction of data from CNL messages and improves the overall functionality of the code.
This commit is contained in:
windyboy
2024-07-29 23:40:51 +08:00
parent 14f3dc7321
commit 91d6957eba
3 changed files with 13 additions and 142 deletions
+2 -2
View File
@@ -65,8 +65,8 @@ const (
// - arrival: the four-letter arrival airport code
arrPatternString = `^\((?P<category>[A-Z]{3})` +
`-(?P<number>[A-Z0-9]+)(\/?(?P<ssr>[A-Z0-9]+))?` +
`-(?P<departure>[A-Z]{4})` +
`-(?P<arrival>[A-Z]{4})(?P<arrival_time>\d{4})\)$`
`-(?P<dep>[A-Z]{4})` +
`-(?P<arr>[A-Z]{4})(?P<arr_time>\d{4})\)$`
// depPatternString represents the regular expression pattern used to match departure patterns.
// The pattern matches strings in the format: "(TYPE-NUMBER-SSR-DEPARTURE-DEPARTURE_TIME-ARRIVAL)".