Extract two double Values from String using RegEx in Java

Posted by tzippy on Stack Overflow See other posts from Stack Overflow or by tzippy
Published on 2010-05-31T13:30:40Z Indexed on 2010/05/31 13:32 UTC
Read the original article Hit count: 175

Filed under:
|

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!

© Stack Overflow or respective owner

Related posts about java

Related posts about regex