From 13b97dab10de7e0c0216c4d72e8e8b61ece6b870 Mon Sep 17 00:00:00 2001 From: Jilles van Gurp Date: Fri, 17 Nov 2023 15:44:36 +0100 Subject: [PATCH] add note to parsing --- src/commonMain/kotlin/com/jillesvangurp/geo/mgrs.kt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/commonMain/kotlin/com/jillesvangurp/geo/mgrs.kt b/src/commonMain/kotlin/com/jillesvangurp/geo/mgrs.kt index c5a683a..b9e12bc 100644 --- a/src/commonMain/kotlin/com/jillesvangurp/geo/mgrs.kt +++ b/src/commonMain/kotlin/com/jillesvangurp/geo/mgrs.kt @@ -221,6 +221,8 @@ private val mgrsRegex = "([0-9]+)\\s*([A-Z])\\s*([A-Z])\\s*([A-Z])\\s*([0-9]{1,5 /** * Parses a mgrs or usng string to [MgrsCoordinate]. Returns the coordinate or null if none was found. + * + * Note the string may contain other things, this implementation simply looks for the first matching coordinate. */ fun String.parseMgrs(): MgrsCoordinate? { return mgrsRegex.find(this)?.let { match ->