I have multiple text file and need to wrap each paragraph in p tags using regex.
i.e. before:
Paragraph 1
Paragraph 2
Paragraph 3
Aft
You can use this regex:
(.+?)(\n|$)+
and replace it with:
$1
\n\n
The problem with your regex is, that it is matching empty lines as well, because you're saying: "Match any character zero or more times, followed by a new line".
You also have to take in count the last paragraph, that might not end with a line break.