Skip to content

Commit

Permalink
add note to parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
jillesvangurp committed Nov 17, 2023
1 parent be4a13d commit 13b97da
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/commonMain/kotlin/com/jillesvangurp/geo/mgrs.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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 ->
Expand Down

0 comments on commit 13b97da

Please sign in to comment.