I want to make a String highlighted with the SpannableString java
I have the following string
textString = "2021-01-26 19:23:18 Lat: 26.369919 Long: 83.46433";
From this, I am able to highlight the String using regex with decimal numbers from this
Pattern regex = Pattern.compile("(\\d+(?:\\.\\d+)?)");
like this
textString = "2021-01-26 19:23:18 Lat: 26.369919 Long: 83.46433";
But now I want to make s String including the ':' in between numbers also and want to avoid the ':' before or after any nonnumeric character
I want to produce output like this
textString = "2021-01-26 19:23:18 Lat: 26.369919 Long: 83.46433";