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.

consider this as my order of the text (paragraph followed by image)...

<p> this is my first paragraph</p>
<img src="http://xyz/123.jpg />

<p>this is my second paragraph</p>
<img src="http://123/xyz.jpg />

<p>this is my third paragraph</p>
<img src="http://123/xyz.jpg />

now i want to change the order of the text using notepad++ like the text below(image followed by paragraph)...

<img src="http://xyz/123.jpg />
<p>this is my second paragraph</p>

<img src="http://123/xyz.jpg />
<p>this is my second paragraph</p>

<img src="http://123/xyz.jpg />
<p>this is my third paragraph</p>
share|improve this question

2 Answers 2

You can do it using the replace funcion coupled with regular expressions:

Search: (<p>.*?</p>)(\s+)(<img[^>]+>)

Replace with: \3\2\1

And select "Regular expressions" with the box ". matches newlines" checked.

share|improve this answer
    
what if there are 1000 occurences....??? –  santoshanis Feb 24 '13 at 16:57
    
Click on "Replace All"? I just did it with 1k orrucrences, it took less than a second to replace them all. Ctrl+H, put the values that I gave and choose the option that I said, and click replace all. 1000 paragraphs/images swapped in less than a second. –  m4573r Feb 24 '13 at 17:03

I think the simplest way to do it is to just select the line and drag it to above the p-tag. As far as I know, there is no other way to do it simplier.

share|improve this answer

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.