Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [php] Wyrazenie regularne
Kostek.88
post
Post #1





Grupa: Zarejestrowani
Postów: 376
Pomógł: 47
Dołączył: 23.08.2007
Skąd: Warszawa

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


Czesc, mam takie cos:

Jakis tekst [#2011-23-M] the quick brown fox jumps over the lazy dog
Jakis tekst [#2013-123-M] lorem ipsum dolor sit amet
Jakis inny tekst [#2012-223-M] the quick brown fox jumps over the lazy dog
Jakis inny tekst [#2015-12323-M] lorem ipsum dolor sit amet

Jak wyciagnac to co jest pogrubione za pomoca wyrazen regularnych?

EDIT: oczywiscie to NIE JEST tak naprawde pogrubiane. Zaznaczylem tylko, zeby bylo widac co chce wyciagnac (IMG:style_emoticons/default/tongue.gif) Zeby mi nikt tu nie pisal o <b> (IMG:style_emoticons/default/wink.gif)

Ten post edytował Kostek.88 1.03.2012, 11:17:26
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi (1 - 2)
nospor
post
Post #2





Grupa: Moderatorzy
Postów: 36 561
Pomógł: 6315
Dołączył: 27.12.2004




  1. $zm = 'Jakis tekst [#2011-23-M] the quick brown fox jumps over the lazy dog
  2. Jakis tekst [#2013-123-M] lorem ipsum dolor sit amet
  3. Jakis inny tekst [#2012-223-M] the quick brown fox jumps over the lazy dog
  4. Jakis inny tekst [#2015-12323-M] lorem ipsum dolor sit amet';
  5. preg_match_all('/\[#\d{4}-(\d+)-M\]/',$zm,$matches);
  6. print_r($matches);


Cytat
EDIT: oczywiscie to NIE JEST tak naprawde pogrubiane. Zaznaczylem tylko, zeby bylo widac co chce wyciagnac Zeby mi nikt tu nie pisal o <b>
Naprawde mogłeś to sobie darować a nie nas obrażać (IMG:style_emoticons/default/tongue.gif)
Go to the top of the page
+Quote Post
Kostek.88
post
Post #3





Grupa: Zarejestrowani
Postów: 376
Pomógł: 47
Dołączył: 23.08.2007
Skąd: Warszawa

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


Dzieki wielkie (IMG:style_emoticons/default/smile.gif) A co do tego <b>... to mam swiadomosc, ze nie kazdy ma taki sam tok rozumowania/myslenia, moze ktos by mnie wzial za idiote niepotrafiacego sobie poradzic z glupim <b> (IMG:style_emoticons/default/tongue.gif) Chcialem uniknac dodatkowego wyjasniania (IMG:style_emoticons/default/wink.gif) Dzieki za pomoc (IMG:style_emoticons/default/smile.gif)
Go to the top of the page
+Quote Post

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

 



RSS Aktualny czas: 20.12.2025 - 20:09