E
E
exxagw2015-12-09 10:41:02
Regular Expressions
exxagw, 2015-12-09 10:41:02

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

1 answer(s)
M
Max, 2015-12-09
@AloneCoder

/\[\[!?\$(.*)\]\]/

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question