I have this regex:
preg_match_all('/{.*?}/', $html, $matches);
Returns all lines written inside curly braces. The $ matches variable also contains the characters {and}. How to remove them?
I do not want to do:
if ($matches[0] == "{variable}")
And I do not want to add (and) characters to the regular expression because I do not want to use:
preg_match_all('/{(.*?)}/', $html, $matches);
if ($matches[0][0] == "variable")
So, is there an easier way to remove curly braces from $ matches in a regular expression?
unska source
share