Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

1 Answer 1

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

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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