Есть строка, содержащая результаты поискового запроса с другого сайта. Задача её обработать.
В строке N вхождений вида
">Любой текст,любой длины, не одинаковый</a>,
Как заменить все эти вхождения на
">Компания</a>,
?
Заранее спасибо.
Спустя 14 минут, 13 секунд (25.03.2011 - 14:56) Chel_Hacker777 написал(а):
Trialit
Регуляркой.
Регуляркой.
Спустя 1 минута, 37 секунд (25.03.2011 - 14:58) Trialit написал(а):
К сожалению - в регулярках не силён. Кодом не поможете?
Спустя 5 минут, 45 секунд (25.03.2011 - 15:03) Chel_Hacker777 написал(а):
Trialit
"> еще где-то встречается в строке?
"> еще где-то встречается в строке?
Спустя 2 минуты, 52 секунды (25.03.2011 - 15:06) Trialit написал(а):
Да, уникально будет лишь сочетание
">XXX</a>,
">XXX</a>,
Спустя 6 минут, 22 секунды (25.03.2011 - 15:13) Chel_Hacker777 написал(а):
Trialit
дайте пример полной строки.
дайте пример полной строки.
Спустя 5 минут, 51 секунда (25.03.2011 - 15:19) Trialit написал(а):
Большой пример получился...
<table cellpadding="0" cellspacing="0" width="100%" border="0">
<tr>
<td width="180">
<table cellpadding="0" cellspacing="0" width="100%" border="0" style="margin-bottom: 10px;margin-top: 0px;font-size:8px;">
<tr>
<td valign="top" align="center">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td height="110" width="160" valign="middle" align="center" style=" border: 1px solid #cccccc; ">
<img src="http://jsconsalt.ru/uploades/photo/thumb_364_7f5f1b87.JPG" alt="" style="border: none; cursor: pointer;" onclick="document.location.href='http://jsconsalt.ru/viewprofile.php?id=111627';">
</td>
</tr>
</table>
<br />
<table cellpadding="3" cellspacing="0" width="100%" border="0" align="center" style="font-size:8px;">
<tr valign="top" align="center" style="font-size:8px;">
<td valign="top" align="center" style="font-size:8px;"><a class="add" href="http://jsconsalt.ru/viewprofile.php?id=111627">юрий</a>,
<strong>
Сдаёт в аренду
Квартиру
</strong>
</td>
<tr align="center" style="font-size:8px;">
<td style="font-size:8px;">Montenegro, Bar, Sutomore, ID №111627</td>
</tr>
<tr align="center" style="font-size:8px;">
<td style="font-size:8px;">
Стоимость аренды за 1 месяц : <strong>
35 EUR </strong>
</td>
</tr>
<tr align="center" style="font-size:8px;">
<td style="font-size:8px;">25:::46:::1021</td>
</tr>
<tr align="center" style="font-size:8px;">
<td id="listing_add_to_comparison_111627" style="font-size:8px;">
<a class="add" href="#" onclick="javascript: AddToComparisonList('111627', 'listing_add_to_comparison_111627');"></a>
</td>
</tr>
</table>
</td>
</tr>
</tr>
</table>
</td><td width="180">
<table cellpadding="0" cellspacing="0" width="100%" border="0" style="margin-bottom: 10px;margin-top: 0px;font-size:8px;">
<tr>
<td valign="top" align="center">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td height="110" width="160" valign="middle" align="center" style=" border: 1px solid #cccccc; ">
<img src="http://jsconsalt.ru/uploades/photo/thumb_1_29dd2caa.jpg" alt="" style="border: none; cursor: pointer;" onclick="document.location.href='http://jsconsalt.ru/viewprofile.php?id=111626';">
</td>
</tr>
</table>
<br />
<table cellpadding="3" cellspacing="0" width="100%" border="0" align="center" style="font-size:8px;">
<tr valign="top" align="center" style="font-size:8px;">
<td valign="top" align="center" style="font-size:8px;"><a class="add" href="http://jsconsalt.ru/viewprofile.php?id=111626">jsconsalt</a>,
<strong>
Сдаёт в аренду
Апартаменты
</strong>
</td>
<tr align="center" style="font-size:8px;">
<td style="font-size:8px;">Montenegro, Budva, Budva, ID №111626</td>
</tr>
<tr align="center" style="font-size:8px;">
<td style="font-size:8px;">
Стоимость аренды за 1 день : <strong>
50 EUR
</strong>
</td>
</tr>
<tr align="center" style="font-size:8px;">
<td id="listing_add_to_comparison_111626" style="font-size:8px;">
<a class="add" href="#" onclick="javascript: AddToComparisonList('111626', 'listing_add_to_comparison_111626');"></a>
</td>
</tr>
</table>
</td>
</tr>
</tr>
</table>
</td><td width="180">
<table cellpadding="0" cellspacing="0" width="100%" border="0" style="margin-bottom: 10px;margin-top: 0px;font-size:8px;">
<tr>
<td valign="top" align="center">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td height="110" width="160" valign="middle" align="center" style=" border: 1px solid #cccccc; ">
<img src="http://jsconsalt.ru/uploades/photo/thumb_1_1a81cf41.jpg" alt="" style="border: none; cursor: pointer;" onclick="document.location.href='http://jsconsalt.ru/viewprofile.php?id=111625';">
</td>
</tr>
</table>
<br />
<table cellpadding="3" cellspacing="0" width="100%" border="0" align="center" style="font-size:8px;">
<tr valign="top" align="center" style="font-size:8px;">
<td valign="top" align="center" style="font-size:8px;"><a class="add" href="http://jsconsalt.ru/viewprofile.php?id=111625">jsconsalt</a>,
<strong>
Сдаёт в аренду
Апартаменты
</strong>
</td>
<tr align="center" style="font-size:8px;">
<td style="font-size:8px;">Montenegro, Budva, Budva, ID №111625</td>
</tr>
<tr align="center" style="font-size:8px;">
<td style="font-size:8px;">
Стоимость аренды за 1 день : <strong>
50 EUR
</strong>
</td>
</tr>
<tr align="center" style="font-size:8px;">
<td id="listing_add_to_comparison_111625" style="font-size:8px;">
<a class="add" href="#" onclick="javascript: AddToComparisonList('111625', 'listing_add_to_comparison_111625');"></a>
</td>
</tr>
</table>
</td>
</tr>
</tr>
</table>
</td><td width="180">
<table cellpadding="0" cellspacing="0" width="100%" border="0" style="margin-bottom: 10px;margin-top: 0px;font-size:8px;">
<tr>
<td valign="top" align="center">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td height="110" width="160" valign="middle" align="center" style=" border: 1px solid #cccccc; ">
<img src="http://jsconsalt.ru/uploades/photo/thumb_1_37e334e1.JPG" alt="" style="border: none; cursor: pointer;" onclick="document.location.href='http://jsconsalt.ru/viewprofile.php?id=111624';">
</td>
</tr>
</table>
<br />
<table cellpadding="3" cellspacing="0" width="100%" border="0" align="center" style="font-size:8px;">
<tr valign="top" align="center" style="font-size:8px;">
<td valign="top" align="center" style="font-size:8px;"><a class="add" href="http://jsconsalt.ru/viewprofile.php?id=111624">jsconsalt</a>,
<strong>
Сдаёт в аренду
Апартаменты
</strong>
</td>
<tr align="center" style="font-size:8px;">
<td style="font-size:8px;">Montenegro, Budva, Becici, ID №111624</td>
</tr>
<tr align="center" style="font-size:8px;">
<td style="font-size:8px;">
Стоимость аренды за 1 месяц : <strong>
2 800 EUR </strong>
</td>
</tr>
<tr align="center" style="font-size:8px;">
<td id="listing_add_to_comparison_111624" style="font-size:8px;">
<a class="add" href="#" onclick="javascript: AddToComparisonList('111624', 'listing_add_to_comparison_111624');"></a>
</td>
</tr>
</table>
</td>
</tr>
</tr>
</table>
</td> </tr><tr>
<td width="180">
<table cellpadding="0" cellspacing="0" width="100%" border="0" style="margin-bottom: 10px;margin-top: 0px;font-size:8px;">
<tr>
<td valign="top" align="center">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td height="110" width="160" valign="middle" align="center" style=" border: 1px solid #cccccc; ">
<img src="http://jsconsalt.ru/uploades/photo/thumb_1_4aab8428.JPG" alt="" style="border: none; cursor: pointer;" onclick="document.location.href='http://jsconsalt.ru/viewprofile.php?id=111623';">
</td>
</tr>
</table>
<br />
<table cellpadding="3" cellspacing="0" width="100%" border="0" align="center" style="font-size:8px;">
<tr valign="top" align="center" style="font-size:8px;">
<td valign="top" align="center" style="font-size:8px;"><a class="add" href="http://jsconsalt.ru/viewprofile.php?id=111623">jsconsalt</a>,
<strong>
Сдаёт в аренду
Апартаменты
</strong>
</td>
<tr align="center" style="font-size:8px;">
<td style="font-size:8px;">Montenegro, Budva, Becici, ID №111623</td>
</tr>
<tr align="center" style="font-size:8px;">
<td style="font-size:8px;">
Стоимость аренды за 1 день : <strong>
80 EUR
</strong>
</td>
</tr>
<tr align="center" style="font-size:8px;">
<td id="listing_add_to_comparison_111623" style="font-size:8px;">
<a class="add" href="#" onclick="javascript: AddToComparisonList('111623', 'listing_add_to_comparison_111623');"></a>
</td>
</tr>
</table>
</td>
</tr>
</tr>
</table>
</td><td width="180">
<table cellpadding="0" cellspacing="0" width="100%" border="0" style="margin-bottom: 10px;margin-top: 0px;font-size:8px;">
<tr>
<td valign="top" align="center">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td height="110" width="160" valign="middle" align="center" style=" border: 1px solid #cccccc; ">
<img src="http://jsconsalt.ru/uploades/photo/thumb_1_676e6be1.jpg" alt="" style="border: none; cursor: pointer;" onclick="document.location.href='http://jsconsalt.ru/viewprofile.php?id=111619';">
</td>
</tr>
</table>
<br />
<table cellpadding="3" cellspacing="0" width="100%" border="0" align="center" style="font-size:8px;">
<tr valign="top" align="center" style="font-size:8px;">
<td valign="top" align="center" style="font-size:8px;"><a class="add" href="http://jsconsalt.ru/viewprofile.php?id=111619">jsconsalt</a>,
<strong>
Сдаёт в аренду
Апартаменты
</strong>
</td>
<tr align="center" style="font-size:8px;">
<td style="font-size:8px;">Montenegro, Budva, Becici, ID №111619</td>
</tr>
<tr align="center" style="font-size:8px;">
<td style="font-size:8px;">
Стоимость аренды за 1 день : <strong>
70 EUR
</strong>
</td>
</tr>
<tr align="center" style="font-size:8px;">
<td id="listing_add_to_comparison_111619" style="font-size:8px;">
<a class="add" href="#" onclick="javascript: AddToComparisonList('111619', 'listing_add_to_comparison_111619');"></a>
</td>
</tr>
</table>
</td>
</tr>
</tr>
</table>
</td><td width="180">
<table cellpadding="0" cellspacing="0" width="100%" border="0" style="margin-bottom: 10px;margin-top: 0px;font-size:8px;">
<tr>
<td valign="top" align="center">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td height="110" width="160" valign="middle" align="center" style=" border: 1px solid #cccccc; ">
<img src="http://jsconsalt.ru/uploades/photo/thumb_1_ee891be8.jpg" alt="" style="border: none; cursor: pointer;" onclick="document.location.href='http://jsconsalt.ru/viewprofile.php?id=111616';">
</td>
</tr>
</table>
<br />
<table cellpadding="3" cellspacing="0" width="100%" border="0" align="center" style="font-size:8px;">
<tr valign="top" align="center" style="font-size:8px;">
<td valign="top" align="center" style="font-size:8px;"><a class="add" href="http://jsconsalt.ru/viewprofile.php?id=111616">jsconsalt</a>,
<strong>
Сдаёт в аренду
Апартаменты
</strong>
</td>
<tr align="center" style="font-size:8px;">
<td style="font-size:8px;">Montenegro, Budva, Buljarica I, ID №111616</td>
</tr>
<tr align="center" style="font-size:8px;">
<td style="font-size:8px;">
Стоимость аренды за 1 месяц : <strong>
1 200 EUR </strong>
</td>
</tr>
<tr align="center" style="font-size:8px;">
<td id="listing_add_to_comparison_111616" style="font-size:8px;">
<a class="add" href="#" onclick="javascript: AddToComparisonList('111616', 'listing_add_to_comparison_111616');"></a>
</td>
</tr>
</table>
</td>
</tr>
</tr>
</table>
</td><td width="180">
<table cellpadding="0" cellspacing="0" width="100%" border="0" style="margin-bottom: 10px;margin-top: 0px;font-size:8px;">
<tr>
<td valign="top" align="center">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td height="110" width="160" valign="middle" align="center" style=" border: 1px solid #cccccc; ">
<img src="http://jsconsalt.ru/uploades/photo/thumb_1_d32592e7.JPG" alt="" style="border: none; cursor: pointer;" onclick="document.location.href='http://jsconsalt.ru/viewprofile.php?id=111615';">
</td>
</tr>
</table>
<br />
<table cellpadding="3" cellspacing="0" width="100%" border="0" align="center" style="font-size:8px;">
<tr valign="top" align="center" style="font-size:8px;">
<td valign="top" align="center" style="font-size:8px;"><a class="add" href="http://jsconsalt.ru/viewprofile.php?id=111615">jsconsalt</a>,
<strong>
Сдаёт в аренду
Апартаменты
</strong>
</td>
<tr align="center" style="font-size:8px;">
<td style="font-size:8px;">Montenegro, Budva, Buljarica I, ID №111615</td>
</tr>
<tr align="center" style="font-size:8px;">
<td style="font-size:8px;">
Стоимость аренды за 1 месяц : <strong>
2 700 EUR </strong>
</td>
</tr>
<tr align="center" style="font-size:8px;">
<td id="listing_add_to_comparison_111615" style="font-size:8px;">
<a class="add" href="#" onclick="javascript: AddToComparisonList('111615', 'listing_add_to_comparison_111615');"></a>
</td>
</tr>
</table>
</td>
</tr>
</tr>
</table>
</td> </tr><tr>
<td width="180">
<table cellpadding="0" cellspacing="0" width="100%" border="0" style="margin-bottom: 10px;margin-top: 0px;font-size:8px;">
<tr>
<td valign="top" align="center">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td height="110" width="160" valign="middle" align="center" style=" border: 1px solid #cccccc; ">
<img src="http://jsconsalt.ru/uploades/photo/thumb_1_19312337.JPG" alt="" style="border: none; cursor: pointer;" onclick="document.location.href='http://jsconsalt.ru/viewprofile.php?id=111614';">
</td>
</tr>
</table>
<br />
<table cellpadding="3" cellspacing="0" width="100%" border="0" align="center" style="font-size:8px;">
<tr valign="top" align="center" style="font-size:8px;">
<td valign="top" align="center" style="font-size:8px;"><a class="add" href="http://jsconsalt.ru/viewprofile.php?id=111614">jsconsalt</a>,
<strong>
Сдаёт в аренду
Апартаменты
</strong>
</td>
<tr align="center" style="font-size:8px;">
<td style="font-size:8px;">Montenegro, Budva, Buljarica I, ID №111614</td>
</tr>
<tr align="center" style="font-size:8px;">
<td style="font-size:8px;">
Стоимость аренды за 1 месяц : <strong>
1 650 EUR </strong>
</td>
</tr>
<tr align="center" style="font-size:8px;">
<td id="listing_add_to_comparison_111614" style="font-size:8px;">
<a class="add" href="#" onclick="javascript: AddToComparisonList('111614', 'listing_add_to_comparison_111614');"></a>
</td>
</tr>
</table>
</td>
</tr>
</tr>
</table>
</td><td width="180">
<table cellpadding="0" cellspacing="0" width="100%" border="0" style="margin-bottom: 10px;margin-top: 0px;font-size:8px;">
<tr>
<td valign="top" align="center">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td height="110" width="160" valign="middle" align="center" style=" border: 1px solid #cccccc; ">
<img src="http://jsconsalt.ru/uploades/photo/man.gif" alt="Пол не указан" style="border: none; cursor: pointer;" onclick="document.location.href='http://jsconsalt.ru/viewprofile.php?id=111613';">
</td>
</tr>
</table>
<br />
<table cellpadding="3" cellspacing="0" width="100%" border="0" align="center" style="font-size:8px;">
<tr valign="top" align="center" style="font-size:8px;">
<td valign="top" align="center" style="font-size:8px;"><a class="add" href="http://jsconsalt.ru/viewprofile.php?id=111613">Алексей</a>,
<strong>
Сдаёт в аренду
Квартиру
</strong>
</td>
<tr align="center" style="font-size:8px;">
<td style="font-size:8px;">Montenegro, Ulcinj, Kruce, ID №111613</td>
</tr>
<tr align="center" style="font-size:8px;">
<td style="font-size:8px;">
Стоимость аренды за 1 месяц : <strong>
1 000 EUR </strong>
</td>
</tr>
<tr align="center" style="font-size:8px;">
<td id="listing_add_to_comparison_111613" style="font-size:8px;">
<a class="add" href="#" onclick="javascript: AddToComparisonList('111613', 'listing_add_to_comparison_111613');"></a>
</td>
</tr>
</table>
</td>
</tr>
</tr>
</table>
</td><td width="180">
<table cellpadding="0" cellspacing="0" width="100%" border="0" style="margin-bottom: 10px;margin-top: 0px;font-size:8px;">
<tr>
<td valign="top" align="center">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td height="110" width="160" valign="middle" align="center" style=" border: 1px solid #cccccc; ">
<img src="http://jsconsalt.ru/uploades/photo/thumb_352_3869f7fe.JPG" alt="" style="border: none; cursor: pointer;" onclick="document.location.href='http://jsconsalt.ru/viewprofile.php?id=111612';">
</td>
</tr>
</table>
<br />
<table cellpadding="3" cellspacing="0" width="100%" border="0" align="center" style="font-size:8px;">
<tr valign="top" align="center" style="font-size:8px;">
<td valign="top" align="center" style="font-size:8px;"><a class="add" href="http://jsconsalt.ru/viewprofile.php?id=111612">Наталья</a>,
<strong>
Сдаёт в аренду
Апартаменты
</strong>
</td>
<tr align="center" style="font-size:8px;">
<td style="font-size:8px;">Montenegro, Kotor, Dobrota I, ID №111612</td>
</tr>
<tr align="center" style="font-size:8px;">
<td style="font-size:8px;">
Стоимость аренды за 1 месяц : <strong>
1 900 EUR </strong>
</td>
</tr>
<tr align="center" style="font-size:8px;">
<td style="font-size:8px;">Сдаю в аренду 3-х комнатную квартиру, расположенную в курортном месте Доброта ( до старого города Ко...</td>
</tr>
<tr align="center" style="font-size:8px;">
<td id="listing_add_to_comparison_111612" style="font-size:8px;">
<a class="add" href="#" onclick="javascript: AddToComparisonList('111612', 'listing_add_to_comparison_111612');"></a>
</td>
</tr>
</table>
</td>
</tr>
</tr>
</table>
</td><td width="180">
<table cellpadding="0" cellspacing="0" width="100%" border="0" style="margin-bottom: 10px;margin-top: 0px;font-size:8px;">
<tr>
<td valign="top" align="center">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td height="110" width="160" valign="middle" align="center" style=" border: 1px solid #cccccc; ">
<img src="http://jsconsalt.ru/uploades/photo/thumb_1_fab6f186.JPG" alt="" style="border: none; cursor: pointer;" onclick="document.location.href='http://jsconsalt.ru/viewprofile.php?id=111611';">
</td>
</tr>
</table>
<br />
<table cellpadding="3" cellspacing="0" width="100%" border="0" align="center" style="font-size:8px;">
<tr valign="top" align="center" style="font-size:8px;">
<td valign="top" align="center" style="font-size:8px;"><a class="add" href="http://jsconsalt.ru/viewprofile.php?id=111611">jsconsalt</a>,
<strong>
Сдаёт в аренду
Апартаменты
</strong>
</td>
<tr align="center" style="font-size:8px;">
<td style="font-size:8px;">Montenegro, Budva, Buljarica I, ID №111611</td>
</tr>
<tr align="center" style="font-size:8px;">
<td style="font-size:8px;">
Стоимость аренды за 1 месяц : <strong>
1 500 EUR </strong>
</td>
</tr>
<tr align="center" style="font-size:8px;">
<td id="listing_add_to_comparison_111611" style="font-size:8px;">
<a class="add" href="#" onclick="javascript: AddToComparisonList('111611', 'listing_add_to_comparison_111611');"></a>
</td>
</tr>
</table>
</td>
</tr>
</tr>
</table>
</td> </tr><tr>
<td width="180">
<table cellpadding="0" cellspacing="0" width="100%" border="0" style="margin-bottom: 10px;margin-top: 0px;font-size:8px;">
<tr>
<td valign="top" align="center">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td height="110" width="160" valign="middle" align="center" style=" border: 1px solid #cccccc; ">
<img src="http://jsconsalt.ru/uploades/photo/thumb_1_aa67e439.JPG" alt="" style="border: none; cursor: pointer;" onclick="document.location.href='http://jsconsalt.ru/viewprofile.php?id=111610';">
</td>
</tr>
</table>
<br />
<table cellpadding="3" cellspacing="0" width="100%" border="0" align="center" style="font-size:8px;">
<tr valign="top" align="center" style="font-size:8px;">
<td valign="top" align="center" style="font-size:8px;"><a class="add" href="http://jsconsalt.ru/viewprofile.php?id=111610">jsconsalt</a>,
<strong>
Сдаёт в аренду
Апартаменты
</strong>
</td>
<tr align="center" style="font-size:8px;">
<td style="font-size:8px;">Montenegro, Budva, Buljarica I, ID №111610</td>
</tr>
<tr align="center" style="font-size:8px;">
<td style="font-size:8px;">
Стоимость аренды за 1 месяц : <strong>
1 500 EUR </strong>
</td>
</tr>
<tr align="center" style="font-size:8px;">
<td id="listing_add_to_comparison_111610" style="font-size:8px;">
<a class="add" href="#" onclick="javascript: AddToComparisonList('111610', 'listing_add_to_comparison_111610');"></a>
</td>
</tr>
</table>
</td>
</tr>
</tr>
</table>
</td><td width="180">
<table cellpadding="0" cellspacing="0" width="100%" border="0" style="margin-bottom: 10px;margin-top: 0px;font-size:8px;">
<tr>
<td valign="top" align="center">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td height="110" width="160" valign="middle" align="center" style=" border: 1px solid #cccccc; ">
<img src="http://jsconsalt.ru/uploades/photo/thumb_1_4db8bd7d.JPG" alt="" style="border: none; cursor: pointer;" onclick="document.location.href='http://jsconsalt.ru/viewprofile.php?id=111609';">
</td>
</tr>
</table>
<br />
<table cellpadding="3" cellspacing="0" width="100%" border="0" align="center" style="font-size:8px;">
<tr valign="top" align="center" style="font-size:8px;">
<td valign="top" align="center" style="font-size:8px;"><a class="add" href="http://jsconsalt.ru/viewprofile.php?id=111609">jsconsalt</a>,
<strong>
Сдаёт в аренду
Апартаменты
</strong>
</td>
<tr align="center" style="font-size:8px;">
<td style="font-size:8px;">Montenegro, Budva, Becici, ID №111609</td>
</tr>
<tr align="center" style="font-size:8px;">
<td style="font-size:8px;">
Стоимость аренды за 1 месяц : <strong>
2 550 EUR </strong>
</td>
</tr>
<tr align="center" style="font-size:8px;">
<td id="listing_add_to_comparison_111609" style="font-size:8px;">
<a class="add" href="#" onclick="javascript: AddToComparisonList('111609', 'listing_add_to_comparison_111609');"></a>
</td>
</tr>
</table>
</td>
</tr>
</tr>
</table>
</td><td width="180">
<table cellpadding="0" cellspacing="0" width="100%" border="0" style="margin-bottom: 10px;margin-top: 0px;font-size:8px;">
<tr>
<td valign="top" align="center">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td height="110" width="160" valign="middle" align="center" style=" border: 1px solid #cccccc; ">
<img src="http://jsconsalt.ru/uploades/photo/thumb_1_f4cc37f0.JPG" alt="" style="border: none; cursor: pointer;" onclick="document.location.href='http://jsconsalt.ru/viewprofile.php?id=111608';">
</td>
</tr>
</table>
<br />
<table cellpadding="3" cellspacing="0" width="100%" border="0" align="center" style="font-size:8px;">
<tr valign="top" align="center" style="font-size:8px;">
<td valign="top" align="center" style="font-size:8px;"><a class="add" href="http://jsconsalt.ru/viewprofile.php?id=111608">jsconsalt</a>,
<strong>
Сдаёт в аренду
Апартаменты
</strong>
</td>
<tr align="center" style="font-size:8px;">
<td style="font-size:8px;">Montenegro, Budva, Becici, ID №111608</td>
</tr>
<tr align="center" style="font-size:8px;">
<td style="font-size:8px;">
Стоимость аренды за 1 месяц : <strong>
2 550 EUR </strong>
</td>
</tr>
<tr align="center" style="font-size:8px;">
<td id="listing_add_to_comparison_111608" style="font-size:8px;">
<a class="add" href="#" onclick="javascript: AddToComparisonList('111608', 'listing_add_to_comparison_111608');"></a>
</td>
</tr>
</table>
</td>
</tr>
</tr>
</table>
</td><td width="180">
<table cellpadding="0" cellspacing="0" width="100%" border="0" style="margin-bottom: 10px;margin-top: 0px;font-size:8px;">
<tr>
<td valign="top" align="center">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td height="110" width="160" valign="middle" align="center" style=" border: 1px solid #cccccc; ">
<img src="http://jsconsalt.ru/uploades/photo/thumb_1_2a5611d9.JPG" alt="" style="border: none; cursor: pointer;" onclick="document.location.href='http://jsconsalt.ru/viewprofile.php?id=111606';">
</td>
</tr>
</table>
<br />
<table cellpadding="3" cellspacing="0" width="100%" border="0" align="center" style="font-size:8px;">
<tr valign="top" align="center" style="font-size:8px;">
<td valign="top" align="center" style="font-size:8px;"><a class="add" href="http://jsconsalt.ru/viewprofile.php?id=111606">jsconsalt</a>,
<strong>
Сдаёт в аренду
Апартаменты
</strong>
</td>
<tr align="center" style="font-size:8px;">
<td style="font-size:8px;">Montenegro, Budva, Becici, ID №111606</td>
</tr>
<tr align="center" style="font-size:8px;">
<td style="font-size:8px;">
Стоимость аренды за 1 день : <strong>
70 EUR
</strong>
</td>
</tr>
<tr align="center" style="font-size:8px;">
<td id="listing_add_to_comparison_111606" style="font-size:8px;">
<a class="add" href="#" onclick="javascript: AddToComparisonList('111606', 'listing_add_to_comparison_111606');"></a>
</td>
</tr>
</table>
</td>
</tr>
</tr>
</table>
</td> </tr><tr>
</tr></table>
Спустя 7 минут, 52 секунды (25.03.2011 - 15:26) Ulan написал(а):
preg_replace('#>.*?</a>,#s', '>Компания</a>,', $input_string);
блин, форум неразрывный пробел вырезает
Спустя 4 минуты, 55 секунд (25.03.2011 - 15:31) Trialit написал(а):
Никакой реакции((
Ulan, попробуй без тега code плз.
Ulan, попробуй без тега code плз.
Спустя 7 минут, 59 секунд (25.03.2011 - 15:39) Ulan написал(а):
preg_replace('#>.*?</a>, #s', '>Компания</a>, ', $input_string);
эта регулярка заменит все теги </a> за которыми идет запятая, пробел, код неразрывного пробела
а эта все теги </a>
preg_replace('#>.*?</a>#s', '>Компания</a>', $input_string);
эта регулярка заменит все теги </a> за которыми идет запятая, пробел, код неразрывного пробела
а эта все теги </a>
preg_replace('#>.*?</a>#s', '>Компания</a>', $input_string);
Спустя 7 минут, 16 секунд (25.03.2011 - 15:47) Trialit написал(а):
Спасибо, но к сожалению не работает....не могу понять почему....
$txt = preg_replace('#>.*?</a>, #s', '>Компания</a>, ', $txt);
В переменной txt содержится текст из образца сверху...
Хелп.
$txt = preg_replace('#>.*?</a>, #s', '>Компания</a>, ', $txt);
В переменной txt содержится текст из образца сверху...
Хелп.
Спустя 4 минуты, 3 секунды (25.03.2011 - 15:51) Chel_Hacker777 написал(а):
Trialit
А так: $txt = preg_replace('>.*?</a>','>Компания</a>', $txt);
А так: $txt = preg_replace('>.*?</a>','>Компания</a>', $txt);
Спустя 6 минут, 51 секунда (25.03.2011 - 15:57) Trialit написал(а):
А так он заменяет все ссылки, при этом - убивая их - вместо ссылки выводит >Компания>
Я тут вот что подумал - первый вариант не работает видимо из-за символов пробела, ведь строка пришла через curl. Как отредактировать первый вариант если:
\ - пробел
\n - перевод каретки на новую строку (прыжок на новую строку)
\r - перевод каретки в начало строки (прыжок в начало строки)
\t - знак продольной табуляции (невидимый пробел)
Я тут вот что подумал - первый вариант не работает видимо из-за символов пробела, ведь строка пришла через curl. Как отредактировать первый вариант если:
\ - пробел
\n - перевод каретки на новую строку (прыжок на новую строку)
\r - перевод каретки в начало строки (прыжок в начало строки)
\t - знак продольной табуляции (невидимый пробел)
Спустя 4 минуты, 8 секунд (25.03.2011 - 16:02) Ulan написал(а):
ошибка вышла, выражение слишком жадное
надо так
preg_replace('#>[^<]*?</a>#s', '>Компания</a>', $input_string);
у меня работает
надо так
preg_replace('#>[^<]*?</a>#s', '>Компания</a>', $input_string);
у меня работает
Спустя 5 минут, 49 секунд (25.03.2011 - 16:07) Trialit написал(а):
Ulan, да, работает, но опять же изменяет лишние ссылки из-за отсутствия запятой и nbsp;
Как подправить скажите пожалуйста?
Как подправить скажите пожалуйста?
Спустя 7 минут, 6 секунд (25.03.2011 - 16:15) Ulan написал(а):
добавить после тега </a> нужные символы
preg_replace('#>[^<]*?</a>, \ #s', '>Компания</a>', $input_string);
попробуйте
вот не помню, амперсанд должен экранироваться вроде
preg_replace('#>[^<]*?</a>, \ #s', '>Компания</a>', $input_string);
попробуйте
вот не помню, амперсанд должен экранироваться вроде
Спустя 4 минуты, 46 секунд (25.03.2011 - 16:19) Trialit написал(а):
Спасибо, не совсем так, но на основе вашего текста -
Вот правильный вариант.
Всё таки пробел приходил в строку как \
$txt = preg_replace('#>[^<]*?</a>,\\ #s', '>Компания</a>, ', $txt);
Вот правильный вариант.
Всё таки пробел приходил в строку как \