Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

6
  • 4
    You understand that this leaves you with an xml file that is syntactically incorrect, i.e. you're missing the closing </Networks> tag by removing the line. Commented Mar 16, 2015 at 10:45
  • yes I know that ( the first Networks exist on the top of the file Commented Mar 16, 2015 at 10:46
  • 2
    Why do you need an ill formed XML file? Commented Mar 16, 2015 at 10:47
  • dont worry later I will append new lines that will be in place that line Commented Mar 16, 2015 at 10:49
  • 4
    Looks like an XY problem to me. What are you -actually- trying to accomplish? Parsing XML with regex is a bad idea, because there's lots of ways it can go wrong. Creating malformed XML deliberately is also a bad idea, for much the same reason. What problem are you trying to solve? I will probably suggest the answer is - use an XML parser, not a regex. With a bit more XML as a sample, this is actually very easy to do. Commented Mar 16, 2015 at 11:11