Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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


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?


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.

Don't.… – Tom O'Connor Mar 17 '12 at 10:40

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
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

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