I have a very large document that contains HTML tags that are split onto multiple lines. All the formatters I've tried do not format them onto single lines.
The regex I have is:
<p>(.|\n)*?<\/p>
However this is selecting both single line and multiline cases.
Here are some test cases (I've noted expected outcome, currently all four are being selected):
// Should NOT match, as it's all on one line:
<p><b>start -</b> Uses an area level ("Name field" from levels.txt) to define where the player starts in the Act</p>
// SHOULD match, as it's multiline:
<p><b>maxnpcitemlevel -</b> Controls the maximum item level for items sold by the NPC in the Act
</p>
// Should NOT match, as it's all on one line:
<p>This file controls global Act functionalities including item levels, monster behaviors, and waypoints</p>
// SHOULD match, as it's multiline:
<p><b>wanderingMonsterRegionTotal -</b> The maximum number of wandering monsters allowed at once
</p>
I've created a regex101:
I have a very large document that contains HTML tags that are split onto multiple lines. All the formatters I've tried do not format them onto single lines.
The regex I have is:
<p>(.|\n)*?<\/p>
However this is selecting both single line and multiline cases.
Here are some test cases (I've noted expected outcome, currently all four are being selected):
// Should NOT match, as it's all on one line:
<p><b>start -</b> Uses an area level ("Name field" from levels.txt) to define where the player starts in the Act</p>
// SHOULD match, as it's multiline:
<p><b>maxnpcitemlevel -</b> Controls the maximum item level for items sold by the NPC in the Act
</p>
// Should NOT match, as it's all on one line:
<p>This file controls global Act functionalities including item levels, monster behaviors, and waypoints</p>
// SHOULD match, as it's multiline:
<p><b>wanderingMonsterRegionTotal -</b> The maximum number of wandering monsters allowed at once
</p>
I've created a regex101: https://regex101.com/r/XLflH4/2
I have found the following regex that seems to work for what I need:
<p>(?:(?!<\/p>).)*\n(?:(.|\n)*?)<\/p>