R
R. K. Wijayaratne
Hello everyone,
I have something similar to the below and I am trying to select just
the Block 1 markup/text <li><ul>...</ul></li> with the following RegEx
@"<li>(.|\n)*<ul>(.|\n)*</ul>\n*</li>", however it selects all 3
blocks. Any ideas how to get around this?
[C#]
string section = Regex.Match(text, @"(<li>(.|\n)*<ul>(.|\n)*</ul>\n*</
li>)").Value;
I have something similar to the below and I am trying to select just
the Block 1 markup/text <li><ul>...</ul></li> with the following RegEx
@"<li>(.|\n)*<ul>(.|\n)*</ul>\n*</li>", however it selects all 3
blocks. Any ideas how to get around this?
[C#]
string section = Regex.Match(text, @"(<li>(.|\n)*<ul>(.|\n)*</ul>\n*</
li>)").Value;
HTML:
<li>Block 1, some text
<ul>
<li>Link 1</li>
<li>Link 2</li>
<li>Link 3</li>
</ul></li>
<li>Block 2, some text
<ul>
<li>Link 4</li>
<li>Link 5</li>
<li>Link 6</li>
</ul></li>
<li>Block 3, some text
<ul>
<li>Link 7</li>
<li>Link 8</li>
<li>Link 9</li>
</ul></li>