Can come a line like:

m689км.150м. а.д Казань-Оренбург-Акбулак гр.Р.Казахстан,движение из г.Оренбург,Сакмарский р-он,52.0157 55.2073689км.150м. а.д Ка 

or:

  672км200м а/дКазань-Оренбург-Акбулак гр.Р.Казахстан,Октябрьский р-н,в г. Оренбург 52.1528 55.2263 

Tell me how to make an expression so that it works, if the numbers after the "." more than three.

  • show what has already happened! Here selects all digits (if digits are more than 3x) after the point \.\d{3,} - JVic
  • @JVic, String regularExpressionForDouble = "((\\ d) + ((\\. \\ d {3,}) +))"; - Max
  • What line specifically need to get as a result? - JVic
  • @JVic, now I get [52.0157, 55.2073689] this is quite satisfactory, I will cut off the excess) - Maxim

1 answer 1

Greater than three digits: [\d]{4,}

Full regular expression: ([\d]+\.[\d]{4,}) or ([\d]+\.[\d]{4,} [\d]+\.[\d]{4,}) .

You can play here .