Thanks for the quick answers but I only get Array as a result when printing $array[1]
Perhaps if you could have a look at what I am doing you may be able to point out what I am doing wrong and this thing does not work. It must be something trivial that I can not see 🙁
$text="begin{data} filespace{aa} begin{title} option end{title} begin{pseudo} species(ae_c11.11) species(new_c__4.4) end{pseudo} derivs{ alll -- - 12 1 21 } begin[0]{positions} 1 2 3 4 5 end{positions} end{data}";
echo $text;
preg_match_all("/filespace{(.?)}/i",$text,$array);
print"<br><br> Result: $array[1]";
preg_match_all("/filespace{([}])}/i",$text,$array);
print"<br><br> Result: $array[1]";
exit;
begin{data} filespace{aa} begin{title} option end{title} begin{pseudo} species(ae_c11.11) species(new_c__4.4) end{pseudo} derivs{ alll -- - 12 1 21 } begin[0]{positions} 1 2 3 4 5 end{positions} end{data}
Result: Array
Result: Array
Thank you in advance!