static function matchAll($pattern, $buffer, $vars, &$matches)
	{
		$tmp = array();
		if ( preg_match_all($pattern, $buffer, $tmp, PREG_SET_ORDER) === FALSE )
			return false;
		else
		{
			// for all matching substrings
			for ( $m = 0 ; $m < count($tmp) ; $m++ )
			{
				$res = array();
				
				// for all named capturing parenthesis 
				for ( $v = 0 ; $v < count($vars) ; $v++ )
					// if this capture group must be returned (name not empty)
					if ( $vars[$v] != '' )
						$res[$vars[$v]] = $tmp[$m][1+$v];		//$matches[0] = full matching string, first matching parenthesis is at column 1
					
				// new matching substring to return
				$matches[] = $res;
			}
			
		
			return true;
		}
	}