// 如何匹配到小數點2位以后的內容var s = '12.34567' // 期望 12.34console.log(s.replace(/\.\d{2}/, '*')) // 12*567console.log(s.replace(/\.[^\d]{2}\d+/, '*')) // 12.34567
正則:如何匹配到小數點2位以后的內容
躍然一笑
2019-03-15 16:19:05