2
Here’s the thing, I’m using the following expression:
<div class="teste">(.+?)</div>
And that’s the content, for example.:
<div class="teste">asdasdad<div>zxczxczxc</div>lkjlkjjlkj</div><div>asdasd</div>
I’d like him to get the right div, which is:
<div class="teste">asdasdad<div>zxczxczxc</div>lkjlkjjlkj</div>
But it returns until the first < /div>:
<div class="teste">asdasdad<div>zxczxczxc</div>
Does anyone know what it can be?
NOTE: I’m doing it in java (android)
NOTE: I already searched in GOOGLE, Stack, etc...
– Marcelo Freitas
There is a limited number of
<div>
's within the<div class="teste">
or there may be N<div>
's ?– JoeyRA
Parsing HTML with regex is not a good idea. You can do this easily and correctly with Xpath, for example:
//div[@class="teste"]
– Anthony Accioly