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

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

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

You must log in to answer this question.

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