i just started with some regexp work and i got a problem right away. what i whant to do is validate html tags.
This works:
$data = "<span class=\"test\">";
if(ereg("^</?[A-Za-z]{1,5} ?(([A-Za-z]){1,12}=\"([A-Za-z0-9]){1,}\"){0,1})?>",$data))
echo "valid";
else
echo "INVALID";
but if i set $data to $data = "<span class=\"test\" title=\"testing\">"; it does not work. (invalid is printed). So i changed the regexp to following:
"^</?[A-Za-z]{1,5}( ?(([A-Za-z]){1,12}=\"([A-Za-z0-9]){1,}\"){0,1})?)*>"
But that does not wok. anybody ideas ?
thanks in advance
enlight