Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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.

share|improve this question

closed as off topic by Tom O'Connor, MadHatter, Ward, voretaq7 Aug 3 '12 at 16:17

Questions on Server Fault are expected to relate to server, networking, or related infrastructure administration within the scope defined by the community. Consider editing the question or leaving comments for improvement if you believe the question can be reworded to fit within the scope. Read more about reopening questions here.If this question can be reworded to fit the rules in the help center, please edit the question.

5  
Don't. stackoverflow.com/questions/1732348/… –  Tom O'Connor Mar 17 '12 at 10:40

1 Answer 1

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

share|improve this answer
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. –  Sean M Mar 18 '12 at 21:48

Not the answer you're looking for? Browse other questions tagged or ask your own question.