I try to extract a comment from a string with ereg.
The only thing i'm sure is that the comment is after "comment:"
and before "something:" or EOF
is there anyway to do this?
I try this code but it seems it doesn't work.
<?php
$buffer1="a: toto b:tata comment: the comment d:titi";
$buffer2="a: toto d:tata comment: the comment b:titi";
$buffer3="a: toto d:tata comment: the comment ";
//replace $buffer by $buffer1,$buffer2,...
if (ereg("comment🙁[A-Za-z0-9_\s]+))",$buffer,$res)){ //find comment
echo $res[1];
}
else echo "not match";
?>