Transform textarea input to paragraphed HTML

Kjurlptvoyfll

New Member
I'd like to transform what the user inputs into an textarea on a html page into a \[code\]<p>\[/code\]-tagged output where each \[code\]<p>\[/code\] is replacing new lines.I'm trying with regular expressions but I can't get it to work. Will someone correct my expression?\[code\]String = "Hey, this is paragraph 1 \n and this is paragraph 2 \n and this will be paragraph 3"Regex = r'(.+?)$'\[/code\]It just results in \[code\]Hey, this is paragraph 1 \n and this is paragraph 2 \n<p>and this will be paragraph 3</p>\[/code\]
 
Back
Top