Searching HTML Gate contents in Java



  • I have an HTML document:

    <span xml:lang="en" lang="en"><b><span>Test Test
    </span></b></span><span>Test</span><span>Test</span>
    

    We need to get the contents on the screen. <span></span> tags so that the result is:

    <span xml:lang="en" lang="en"><b><span>Test Test </span></b></span>
    <span>Test</span>
    <span>Test</span>
    

    I understand the best way to do this through regular expressions, but I've only met them and I haven't been able to spell it out on my own. Full condition:

    The first part of the main method comes the tag. Like "span" Put all the theories that correspond to the current Each tag on the new line, the order must be in line with the sequence of the file. Number of gaps, /n, /r do not affect the result The file does not contain the CDATA tag, there is a separate closing strategy for all openings, no single tags. The Hague may contain the encumbered theories



  • It's the best thing to do through the HTML password libraries. For example http://jsoup.org ♪

    Regexp will have to take into account any gaps in the transfer of lines, etc., and it will be weakly readable, and it will not be possible to make changes, especially if they are not well known.

    https://softwareengineering.stackexchange.com/questions/223634/what-is-meant-by-now-you-have-two-problems

    https://stackoverflow.com/a/677045/1646082 ♪

    https://stackoverflow.com/a/1732454/1646082 ♪




Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2