Extract two double Values from String using RegEx in Java
- by tzippy
I am reading a file by line and need to extract latitude and longitude from it.
This how lines can looks:
DE 83543 Rott am Inn Bayern BY Oberbayern Landkreis Rosenheim 47.983 12.1278
DE 21147 Hamburg Hamburg HH Kreisfreie Stadt Hamburg 53.55 10
What's for sure is, there are no dots surrounded by digits except for the ones representing the doubles.
Unfortunately there are Values without a dot, so it's probably best to check for numbers from the end of the String.
thanks for your help!