This is my javascript regex: /^(\d+\.?\d{0,2})$/ My target is to replace all inputs according to it. Is that possible? Example:
123a.12 => 123.12
aaa12aa => 12
12.aaa13 => 12.13
12.aaa => 12
12.555 => 12.55
12.... => 12
12. => 12
12.35.12.14 => 12.35
12.aaa.2.s.5 => 12.25
I was using str.replace(/^(\d+\.?\d{0,2})$/, '') but with no success