Skip to content

Coordinate

Giuseppe Cannella edited this page Jan 11, 2019 · 2 revisions
Type name example
Coordinate N90.00.00 E180.00.00
import com.github.gekomad.regexcollection.Coordinate
import com.github.gekomad.regexcollection.Validate.validate

assert(validate[Coordinate]("N91.00.00 E181.00.00") == None)
assert(validate[Coordinate]("N00.00.00 W181.00.00") == None)
assert(validate[Coordinate]("Z34.59.33 W179.59.59") == None)
assert(validate[Coordinate]("N90.00.00 E180.00.00") == Some("N90.00.00 E180.00.00"))
assert(validate[Coordinate]("S34.59.33 W179.59.59") == Some("S34.59.33 W179.59.59"))
assert(validate[Coordinate]("N00.00.00 W000.00.00") == Some("N00.00.00 W000.00.00"))

Clone this wiki locally