Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> [PHP]eregi_replace to preg_match
miras
post 10.10.2019, 16:04:35
Post #1





Grupa: Zarejestrowani
Postów: 1 004
Pomógł: 9
Dołączył: 18.01.2011
Skąd: Siedlce

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


Witam, mógłby mi ktoś pokazać jak w preg_match powinno wyglądać takie wyrazenie?

  1. eregi_replace("$CensorList[$i]([^a-zA-Z0-9])","$Replace\\1",$EditedMessage);


--------------------
Go to the top of the page
+Quote Post
Tomplus
post 10.10.2019, 18:45:43
Post #2





Grupa: Zarejestrowani
Postów: 1 828
Pomógł: 225
Dołączył: 20.03.2005
Skąd: Będzin

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


  1. preg_match("/{$CensorList[$i]}([^a-zA-Z0-9])/", $EditedMessage, $Results);
Go to the top of the page
+Quote Post
trueblue
post 10.10.2019, 18:55:59
Post #3





Grupa: Zarejestrowani
Postów: 6 761
Pomógł: 1822
Dołączył: 11.03.2014

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


  1. preg_replace("/$CensorList[$i]([^a-zA-Z0-9])/i", "$Replace\\1", $EditedMessage);


Na pewno preg_match?

Ten post edytował trueblue 10.10.2019, 19:00:27


--------------------
Go to the top of the page
+Quote Post
miras
post 21.10.2019, 20:38:49
Post #4





Grupa: Zarejestrowani
Postów: 1 004
Pomógł: 9
Dołączył: 18.01.2011
Skąd: Siedlce

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


Coś takiego wywala mi błąd:

  1. while (preg_replace("/<(/?[[:alpha:]]*)[[:space:]]*([^>]*)>/i",$str,$reg)) {


preg_replace(): Unknown modifier '?' in


Podpowie ktoś jak to powinno wyglądać?


--------------------
Go to the top of the page
+Quote Post
trueblue
post 21.10.2019, 21:30:38
Post #5





Grupa: Zarejestrowani
Postów: 6 761
Pomógł: 1822
Dołączył: 11.03.2014

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


Znaki specjalne należy escape'ować, czyli:
/<(\/?[...

Ten post edytował trueblue 21.10.2019, 21:31:04


--------------------
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: 28.03.2024 - 21:13