How can I replace everything between 2nd "." and “:” in java?
<p>Been researching online but haven't been able to find a solution. </p>

<p>I've got the following string '555.8.0.i5:790.2.0.i19:904.1.0:8233.2:' in Java.</p>

<p>Whats the best way I can remove everything from and including the second dot to the colon?
I want the string to end up looking like this: <code>555.8:790.2:904.1:8233.2:</code></p>

<p>I saw on another post someone had referenced the second dot with java regex <strong>(\d+.\d.)</strong> but I'm not sure how to do the trim. </p>

<p>EDIT:
I have tried the following java regex <code>.replaceAll("\\.(.*?):", ":");</code> but it seems to remove everything from the first dot. Not sure how to get it to trim from the second dot.</p>