To tag content?

the <div>Content_1</div>
the <div>Content_2</div>
<div class="bla-bla">Content_3</div>


How to write a generic regular expression to get the contents between all tags of a div without using libraries? At the same time div'and can have many attributes.

Thanks in advance.
March 19th 20 at 09:25
1 answer
March 19th 20 at 09:27
Forget about regular expressions to parse XML, use DOM, XPath, XSL, anything that is really set up for this purpose.

And you, in the best tradition, did not specify the language or environment.
Goal: to use the library, so ask. Php - laila.Schinn commented on March 19th 20 at 09:30
@laila.Schinn, it is extremely harmful for the efficiency goal. - Sadye commented on March 19th 20 at 09:33
@Sadye, It will not be used in a real project, just wondering. - laila.Schinn commented on March 19th 20 at 09:36
@laila.Schinnand use without libraries, what prevents it? - hallie52 commented on March 19th 20 at 09:39
@laila.Schinn, puff knows how to work with the dom/xpath from the box library only makes this work more comfortable. - hallie52 commented on March 19th 20 at 09:42
@laila.Schinn, to set ourselves the task such as "programming's head down, pressing his nose, not your hands" no one can deny, but, at the same time, it does not cease to be stupid. - Sadye commented on March 19th 20 at 09:45

Find more questions by tags Regular expressionsPHP