Super User is a question and answer site for computer enthusiasts and power users. 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 a large XHTML file that contains a lot of code, see the below example:

<a:CreationDate>0</a:CreationDate>
<a:Creator/>
<a:ModificationDate>0</a:ModificationDate>
<a:Modifier/>
<a:name>stack</a:name>

<a:CreationDate>0</a:CreationDate>
<a:Creator/>
<a:ModificationDate>0</a:ModificationDate>
<a:Modifier/>
<a:name>user</a:name>

How can I export or select a specific line? In the example I want to have such result:

<a:name>stack</a:name>
<a:name>user</a:name> 

and the rest of the code should be ignored.

share|improve this question
up vote 3 down vote accepted

You could try using the Notepad++ replace (CTRL+H) in Regular Expression mode and search for this:

^((?!<a:name>.*</a:name>).)*$

And replace it with blank.

This is a negative look-around match that will select everything that is NOT contained between <a:name> </a:name> tags.

You can easily remove any remaining blank lines with the Notepad++ TextFX plugin (TextFX Edit->Delete Blank Lines)

share|improve this answer
    
can't vote up but you answer was good. Thanks – Moudiz Jul 19 '13 at 9:42

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .