I have data in the form:
<ol>
<li>example1</li>
<li>example2</li>
<li>example3</li>
</ol>
which needs to turn into
# example1
# example2
# example3
The pound sign has to be associated with the ol html tag. I'm using java regular expressions and this is what I have so far:
info = info.replaceAll("(?s).<ol>\n(<li>(.*?)</li>\n)*</ol>","# $2");
info is a string object containing the data. Also there may be line breaks in between the li tags.When I run it, it only prints the last item. i.e the result is
# example3
example2 and example1 are missing
Any thoughts on what I'm doing wrong?