I want to replace all text what start with “{” and end with “}” including those “{” and “}”. Text between them may be anything. =(
I guess I need to use regex’s there.
Let’s imagine that $this->output is string that I want to replace. So I got this far… It don’t work by the way. =(
$this->output = preg_replace( '/{*(.*)*}/', $this->output, $this->output );
You need to escape the
*:Otherwise
*is interpreted as quantifier. Furthermore, to have.*not to match as much as possible, make the*quantifier reluctant: