Can anyone provide (just for my reference) the POSIX regular expression version of the following:
$output = "
<!-- KEY:VALUE1 -->
<!-- KEY:VALUE2 -->
";
preg_match_all("/<!-- KEY🙁.*?) -->/",$output,$functions);
In preg, this returns the following:
$function[0][0] with value '<!-- KEY:VALUE1 -->' / $function[1][0] with value 'VALUE1'
and
$function[0][1] with value '<!-- KEY:VALUE2 -->' / $function[1][1] with value 'VALUE2'
While I've got it working fine in the preg version, I've yet to be able to get ereg set the proper values. I know I'm missing something very simple since I did get back the following as $function[1] with the ereg version:
"VALUE1 -->
<!-- KEY:VALUE2"
(it matches the widest instance rather then the narrowest instance).
Also, can anyone make arguements as to why the POSIX style expressions should or should not be favored over perl style expressions.
Thanks in advance.
Scott A. Hammond, Sr., CEO
Prima Internet, Inc.