I am having trouble trying to get some replaces working with my regex.
Here is some sample data I'm working with :
$/Data:
$One
$Two
$/New:
$Four
$Five
Here is the result I'd like to obtain :
$/Data/One
$/Data/Two
$/New/Four
$/New/Five
Currently, I'm using this regex :
(\$/.*?):\r\n(?:(?:\$(.*)\r\n)*)+
This allows me to capture this data
\1 => $/Data
\2 => One
Two
... same for other group
Is there a way to get the desired result with a regex ? Currently, when I use a \1/\2
replace, I only get the replace for the last item of the \2 capture group.