Reputation: 4183
This is a stupid question but I would like to remove {{Lien web ....}} (including brakets) inside a string.
Example :
test {{Lien web|xyz}} test {{xyz}} test
Result should be :
test test {{xyz}} test
I tried with :
preg_replace('/\{\{.*?\}\}\s*/s','',$string);
but how to add "Lien web" ?
Thanks a lot!
Upvotes: 0
Views: 150
Reputation: 9650
The regex is \{\{Lein web[^\}]*]\}\}
and the respective preg_replace:
preg_replace('/\{\{Lien web[^\}]*\}\}/','',$string, -1);
The last -1 replaces all {{Lien web...}} occurrences
Upvotes: 1