Answer the question
In order to leave comments, you need to log in
How to compose a regexp?
You need to get what's inside the brackets, or rather "param" if $content contains or
$content = 'Test ';
$pattern = '@\[\[\$(.+?)\]\]@si';
if (preg_match($pattern, $content, $matches) > 0) {
$tag = $matches[0];
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question