Regular Expressions 101

Replace \n by <br />

Open Workspace
  • JavaScript
  • Substitution
2

Regular Expression

/
(\n|\\n)(?!$)
/
g

Description

Replace non-ending string \n by the HTML tag

Submitted by Anonymous