From cc5272cd4be2ab55fa8411790082be408b586be9 Mon Sep 17 00:00:00 2001 From: Arturs Artamonovs Date: Tue, 2 Jul 2024 10:07:49 +0100 Subject: Make ADSBDecoder more modular. Integrate into LearnMapKit --- ADSBDecoder/ADSBRegEx.swift | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 ADSBDecoder/ADSBRegEx.swift (limited to 'ADSBDecoder/ADSBRegEx.swift') diff --git a/ADSBDecoder/ADSBRegEx.swift b/ADSBDecoder/ADSBRegEx.swift new file mode 100644 index 0000000..e9ebe17 --- /dev/null +++ b/ADSBDecoder/ADSBRegEx.swift @@ -0,0 +1,35 @@ +// +// ADSBRegEx.swift +// ADSBDecoder +// +// Created by Jacky Jack on 30/06/2024. +// + +import Foundation +import RegexBuilder + +let matchADSBLong = Regex { + Anchor.startOfLine + "*" + + Repeat( + CharacterClass( + ("a"..."f"), + ("0"..."9") + ) + ,count:28) + + ";" +} + +let matchADSBShort = Regex { + Anchor.startOfLine + "*" + Repeat( + CharacterClass( + ("a"..."f"), + ("0"..."9") + ) + ,count:14) + ";" +} -- cgit v1.2.3