1

I have an .xml file. The tags inside are:

<Info>Product</Info>

Now, I have 20 000 tags like this in the file. One tag however, starts properly but it is missing a proper closing tag. How can I find which line starts properly but does not end with the proper tag?

Thanks.

Stole
  • 111
  • 1

1 Answers1

5

Regular expressions is usually not the best tool for xml. It's usually better to use some kind of parser specially written for xml. For xml verification you may want to try xmllint tool

rvs
  • 4,125
  • 1
  • 27
  • 31
  • 1
    Especially since an XML parser *knows* what XML is supposed to look like and can show exactly where the error is without the trial-and-error of refining a regex for the specific case. – Brighid McDonnell Mar 18 '12 at 21:48