Answer the question
In order to leave comments, you need to log in
How to select all pairs of tags in a string?
Tell me, how can I get all pairs of tags with text inside from a string?
For example, we have this line:
<b>Ключ <br> 1:</b>Значение 1<br><b>Ключ 2:</b>Значение 2<br><b>Ключ 3:</b>Значение 3<br><b>Ключ 4:</b>Значение 4<br>
<b>Ключ <br> 1:</b>
<b>Ключ 2:</b>
<b>Ключ 3:</b>
<b>Ключ 4:</b>
<(a|p|b)>.*<\/\1>
<(a|p|b)>[^\1]+<\/\1>
<b>Ключ <br> 1:</b>Значение 1<br>
<b>Ключ 2:</b>Значение 2<br>
<b>Ключ 3:</b>Значение 3<br>
<b>Ключ 4:</b>Значение 4<br>
<(a|p|b)>.*<\/\1>
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question