I need some help figuring out an regular expression. In my script I have a certain line with placeholders. What I want to do is I want to send every placeholder text a an function that translates it to what it should be.
E.g. my text is:
Lorem ipsum dolor sit {{AMETPLACEHOLDER}}, consectetur adipiscing elit.
I want the text AMETPLACEHOLDER to be send of to my function translateMe
.
I am really bad in regex but gave it a try anyways. I don't get further than this:
$sString = preg_replace("(*.?)/\{{(*.?)}}(*.?)/", $this->echoText('\\2'), $sString);
Which off course doesn't work.
Can anybody help me out?
Br, Paul Peelen