I want to match the following string with a regular expression:
$string ="test string [% code content ='test content' class ='myclass' %]";
I want to extract the class and content from this string in percentage braces. Iam using this pattern for matching
$regex_pattern = "/[% ?.*](.*)[\/%]/";
preg_match_all($regex_pattern,$content,$matches);
but not getting the output that I require.