I have an HTML document:
<span xml:lang="en" lang="en"><b><span>Test Test </span></b></span><span>Test</span><span>Test</span> You need to display the contents of the <span></span> tags so that the result is as follows:
<span xml:lang="en" lang="en"><b><span>Test Test </span></b></span> <span>Test</span> <span>Test</span> As I understand it, it is best to solve such a problem through regular expressions, but I only met them and on my own I could not write an expression for this task. Complete condition of the problem:
The first parameter in the main method comes tag. For example, "span". Output to the console all tags that correspond to a given tag. Each tag is on a new line, the order must correspond to the order in the file. The number of spaces, \ n, \ r do not affect the result. there is a separate closing tag, no single tags. The tag may contain nested tags.