http://www.example.com,else, if rel="nofollow" then http://www.example.com else a href="http://mysite.com/go.php=http://www.example.com" target="_blan - Problems and solutions to issues related to Software : Business, Database, Firewalls, Office, Graphics, Security, System, Server.

Question : if rel="nofollow" then http://www.example.com else a href="http://mysite.com/go.php=http://www.example.com" target="_blan

Hello Dear Developers.
I have small issue with analyzing content of some HTML code.
1:
2:
3:
4:
5:
6:
7:
$data='All these people slimmed down and got incredible results. They transformed their bodies the way they wanted.
<p><a href="http://example.com/2009/01/22/incredibly_slimming_down_27_pics.html" target="_blank">Incredibly slimming down (27 pics)</a></p>

<p><a rel="nofollow" href="http://example.com/2009/08/07/amazingly_slimming_down_2_9_pics.html" target="_blank">Amazingly slimming down 2 (9 pics)</a></p>

<p><a href="http://example.com/2009/12/16/amazingly_slimming_down_3_10_pics.html" target="_blank">Amazingly Slimming Down 3 (10 pics)</a></p>
';



if you see the second link it has rel="nofollow" rest haven't it.

So whats required.

I need regexp string which will add http://mysite.com/go.php= to link Where not rel tag used.

so result should be:

1:
2:
3:
4:
5:
6:
7:
8:
$data='All these people slimmed down and got incredible results. They transformed their bodies the way they wanted.
<p><a href="http://mysite.com/go.php=http://example.com/2009/01/22/incredibly_slimming_down_27_pics.html" target="_blank">Incredibly slimming down (27 pics)</a></p>

<p><a rel="nofollow" href="http://example.com/2009/08/07/amazingly_slimming_down_2_9_pics.html" target="_blank">Amazingly slimming down 2 (9 pics)</a></p>

<p><a href="http://mysite.com/go.php=http://example.com/2009/12/16/amazingly_slimming_down_3_10_pics.html" target="_blank">Amazingly Slimming Down 3 (10 pics)</a></p>

';

Answer : if rel="nofollow" then http://www.example.com else a href="http://mysite.com/go.php=http://www.example.com" target="_blan

I told you we were getting close; it was just a matter of finding the substring either $1, $2, or $3.  So... You're not going to give me any points even though you used my entire solution except one number (3 where I said 1 and told you that it could be a miscalculation)?
Random Solutions  
 
programming4us programming4us