I have been struggling with this regex for while. I'm trying to transfer some HTML to mark down.
I have this code:
`"<ol>
<li>This is a new list</li>
<ol>
<li>Embedded List</li>
<li>Embedded List</li>
</ol>
</ol>"`
I need to add 4 space to all the <li>
that are within two <ol>
So just the second to <li>
elements need the 4 spaces.
The regex in pseudo code would be find all <li>
preceded by "<ol>
any characters and <ol>
.
This is what I tried so far (?<=\"<ol>\r\n)(?<=[A-Za-z]<ol>\r\n)<li>
but no luck. Is this even possible using regex?
)[\s\S]*?<\/ol>)`](https://regex101.com/r/dZ4mM1/1).