Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> [PHP]Problem z wyrażeniem regularnym
foxbond
post 10.04.2010, 19:27:23
Post #1





Grupa: Zarejestrowani
Postów: 162
Pomógł: 12
Dołączył: 20.12.2009
Skąd: Siedlce

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


Jak za pomocą wyrażeń regularnych wyciągnąć liczbę 6 questionmark.gif
  1. @<b style="font-size: 15;">Jakiś tekst</b> (x6)
  2. <br>
  3. <i>


Próbowałem tak:
  1. preg_match('/<\/b> (x([0-9]+))/', $gra_curl, $ile);
  2. print_r($ile);
  3. //lub
  4. preg_match('/^<\/b> (x([0-9]+))$/', $gra_curl, $ile);
  5. //lub
  6. preg_match('/<\/b> \(x([0-9]+)\)/', $gra_curl, $ile);
  7. //lub
  8. preg_match('/<\/b> (x[0-9])/', $gra_curl, $ile);
  9. //itd.


Ale jedynym wynikiem było
Kod
Array
(
)
lub

Array


Z góry dziękuję.

Ten post edytował foxbond 10.04.2010, 19:36:47
Go to the top of the page
+Quote Post
Wicepsik
post 10.04.2010, 19:59:02
Post #2





Grupa: Zarejestrowani
Postów: 1 575
Pomógł: 299
Dołączył: 26.03.2009

Ostrzeżenie: (20%)
X----


  1. $s = '@<b style="font-size: 15;">Jakiś tekst</b> (x6)
  2. <br>
  3. <i>
  4. ';
  5.  
  6. preg_match('/(x([0-9])+)/', $s, $d); print_r($d);


--------------------
Go to the top of the page
+Quote Post

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: 15.07.2025 - 04:18