Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> preg_match, Moja slaba strona :(
ksiadz
post 22.02.2005, 16:56:53
Post #1





Grupa: Zarejestrowani
Postów: 39
Pomógł: 0
Dołączył: 24.11.2003

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


Witam
Potrzebuje napisac wyrazenie regularne ktore zamieni string
  1. <?php
  2.  
  3. &#092;"sessions s, members m, groups g\"
  4.  
  5. ?>

na
  1. <?php
  2.  
  3. &#092;"tbl_sessions s, tbl_members m, tbl_groups g\"
  4.  
  5. ?>

moze to jest i banalne ale wyrazenia regularne to dla mnie nadal "czarna magia", wiec prosze o wyrozumialosc


--------------------
If you can't find a program that does what you want it to do, then write your own.
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi (1 - 3)
Coyote
post 22.02.2005, 17:57:49
Post #2





Grupa: Zarejestrowani
Postów: 151
Pomógł: 0
Dołączył: 20.02.2005
Skąd: Poznań

Ostrzeżenie: (30%)
XX---


o wyrażeniach regularnych:
Wyrażenia regularne cz.1
Wyrażenia regularne cz.2
Wyrażenia regularne cz.3


--------------------
Go to the top of the page
+Quote Post
crash
post 22.02.2005, 18:49:50
Post #3





Grupa: Przyjaciele php.pl
Postów: 2 196
Pomógł: 2
Dołączył: 17.01.2004
Skąd: Sosnowiec

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


  1. <?php
  2. $string = 'sessions s, members m, groups g';
  3. echo preg_replace('#[a-z]+ [a-z]{1}#i', 'tpl_0', $string);
  4. ?>


--------------------
Go to the top of the page
+Quote Post
ksiadz
post 22.02.2005, 19:26:45
Post #4





Grupa: Zarejestrowani
Postów: 39
Pomógł: 0
Dołączył: 24.11.2003

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


Wielkie dzieki, obaj ułatwiliście mi życie cool.gif


--------------------
If you can't find a program that does what you want it to do, then write your own.
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: 20.07.2025 - 06:19