Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [HTML][PHP]Regexp - jak wyciaganc tylko tekst
dolar
post 24.05.2017, 10:06:19
Post #1





Grupa: Zarejestrowani
Postów: 92
Pomógł: 0
Dołączył: 19.10.2016

Ostrzeżenie: (0%)
-----


MAm taki oto zapis z html:

  1. <div class="latestItemIntroText">
  2.  
  3. <div class="itemLinks">
  4. <div class="share">Share</div>
  5. <div class="dummy-div"></div>
  6.  
  7. <div class="addthis_sharing_toolbox"></div>
  8.  
  9.  
  10. </div> (</p> ---> to moze byc lub nie)
  11.  
  12. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip
  13. (<br /><br />) -> tutaj tez czasem moze byc lub nie jakas br lub cokolwiek
  14. ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum
  15.  
  16. </p><br/> --> to tez moze sie pojawic lub nie </div>


Jak do tej pory mam taki zapis:

<div class="addthis_sharing_toolbox"><\/div>([ \s?]+)<\/div>([^<]+)<\/div>

To mi ladnie wyciaga tekst, ale bez <p>, bo jesli znajdzie sie tam pomiedzy <p> lub <br/> to juz jest problem i mi nie wyciaga textu. Jak mozna ulepszyc moj zapis regex? O ile da sie cos takiego w ogole wyciaganc...

Go to the top of the page
+Quote Post

Posty w temacie


Reply to this topicStart new topic
1 Użytkowników czyta ten temat (1 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Wersja Lo-Fi Aktualny czas: 25.07.2025 - 00:09