Sorry for dropping an other preg_match
regular expression question. I have been dealing with this issue for too long and can't get it to work, so any help is appreciated!!
I need a simple preg_match_all to return me placeholder for the format [@varname]
.
in a string
"hello, this is [@firstname], i am [@age] years old"
I would expect an array with the values 'firstname' and 'age'.
my attempt for [varname]
that worked was:
preg_match_all("/[([^]]+)]/", $t, $result);
anything i tried to get the @character included failed...
preg_match_all("/[\@([^]]+)]/", $t, $result);