I'm trying to write a tool that will find empty XML tags which are spanned across multiple lines in a large text file. E.g. don't match:
<tag>
ABC
</tag>
And match:
<tag>
</tag>
I have no problem in writing the regex to match whitespace across multiple lines, but I need to find the line numbers where these matches occur (approximately at least).
I would split my text file into an array, but then it'll be pretty tricky to match across multiple array elements as there may be > 2 lines of tags/whitespace.
Any ideas? My implementation needs to be in Perl. Thanks!