I have a string where some part of the string is inside braces, and I would like to get them in an array.
The string is for example: Lorem {{ipsum}} dolor sit amet, {{consectetur}} adipiscing elit.
And I would like to get: array("ipsum", "consectetur")
I tried this:
$regExp = "/\{\{([^)]+)\}\}/";
$result = preg_grep($regExp, array("Lorem {{ipsum}} dolor sit amet, {{consectetur}} adipiscing elit."));
but I get back the given string as result