I want to match this HTML tag using Regex and get the inner text for <ul>
tag
<ul class="test">
<li>Data</li>
<li>Data</li>
<li>Data</li>
</ul>
given that <ul class="test">
is fixed ,, I want to match the inner data of this tag
I want to match this HTML tag using Regex and get the inner text for <ul>
tag
<ul class="test">
<li>Data</li>
<li>Data</li>
<li>Data</li>
</ul>
given that <ul class="test">
is fixed ,, I want to match the inner data of this tag
You should try this if you're sure you won't have ul tag inside your ul tag:
/<ul class="test">(.*?)<\/ul>/
If, however, you do have nested tags, well, it'd depends on what language you're using. Eg, in PHP:
/<ul.*?>((?:(?R)|.)*?)<\/ul>/