“It’s only work if somebody makes you do it.” • craft code • creative ideas • cutting edge • author • senior front end architect • professional scuba diver • adventures above and below the sea level
Location
Germany
Work
Senior Front End Architect, Full Stack Engineer, Creative Technologist and Scuba Diving Professional
If the regular expression is not dynamic, you can use a RegExp literal, ie.
/\r?\n/g
.Hi Alex,
thank you for your contribution. Adjusted
replace(new RegExp("\r?\n", "g"), "<br />")
toreplace(/\r?\n/g, "<br />")
Cheers!