I am still struggling learning my way around regex in Javascript. I'm trying to create a markdown converter that will convert like the following:
> this text should be matched
--> <span>this text should be matched</span>
I've got that down, but I'm trying to make it more complex, as shown below:
> this is a match
> so is this, but should be in the same match as above
> this should be a seperate match > this is nothing
would equal:
<span>this is a match so is this, but should be in the same match as above</span>
<span>this should be a seperate match > this is nothing</span>
But the issue I am having is that using the regex I currently have (/^\>(.*?)(?=\>|\n\n)/gm
), it is picking up the first two as seperate matches.
See my example here: https://regex101.com/r/cZkJAT/2
Any help would be great, thanks.