Hi, >> because nothing matches the whitespace character, and foo is also not >> matched. i would suggest following regular expression: > Never mind, I sorted it out. Sorry for bothering.
no problem. i was actually indirectly asking for advice, because this regular expression still doesn't work properly. >> parray_tree($matches); > Looks nice, where do I get this? (Or have I missed this?) it's a script a friend of me wrote. it produces much nicer output than var_dump(), IMHO. it is in my auto_prepend file because it comes in very handy when you want to analyse the output of preg_* functions. would be nice if you left the credits untouched. --- snip ---------------------------------------- /* by Roland Tapken <[EMAIL PROTECTED]> */ function array_tree($array , $prep='') { if(!is_array($array)) { print '<b>array_tree:</b> This is not an array<br>'; return false; } $prep .= '|'; while(list($key, $val) = each($array)) { $type = gettype($val); if(is_array($val)) { $line = "-+ $key ($type)\n"; $line .= array_tree($val, "$prep "); } else { $line = "-> $key = \"$val\" ($type)\n"; } $ret .= $prep.$line; } return $ret; } function parray_tree($array) { print '<pre>'; print htmlspecialchars(array_tree($array)); print '</pre>'; return true; } --- Snip ---------------------------------------- Kind Regards, Daniel Lorch -- if(empty($a) == true ? true : false) -- PHP Development Mailing List <http://www.php.net/> To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]