Use regular to realize the text with 3 periods and then change the line, how to achieve this?

var articleContent = data.content.replace (/ (? = (). {2}) + $) / g,"< br/ >")
what I wrote is wrong, is there a god!

May.22,2021

Why do you use positive assertions here? Direct data.content.replace (/ [.] {3} / g,'$& < br/ >') No?


let text = ''
let res = text.replace(/(.+?{3})/, '$1\n')
console.log(res)

Preview address: https://regex101.com/r/aChFCH/2

Menu