Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> [PHP]eregi_replace to preg_match
miras
post
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
Post #2





Grupa: Zarejestrowani
Postów: 1 879
Pomógł: 230
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
Post #3





Grupa: Zarejestrowani
Postów: 6 806
Pomógł: 1828
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
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
Post #5





Grupa: Zarejestrowani
Postów: 6 806
Pomógł: 1828
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
2 Użytkowników czyta ten temat (2 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 23.08.2025 - 07:52