Regular expression replacing only if contained withing a regular expression match?
- by Tower
Hi,
I have the following:
[list]
[*] test
[*] test
[*] test
[/list]
and I would like to create a regular expression that turns that into:
<ul>
<li>test</li>
<li>test</li>
<li>test</li>
</ul>
I know regex enough to replace simple tags, but in this case I need to replace li tags only if they are contained inside ul. Is there a way to check that before replacing?
I am using JavaScript if that matters.