Parse first word from request path - first element between first two slashes.
Return for example from `/eshop/detail/name` first word `eshop`.
If there is no first word in request path, return an empty string.
@return string
548029
protected function rewriteRoutingGetReqPathFirstWord () {
		$requestedPath = ltrim($this->request->GetPath(), '/');
		$nextSlashPos = mb_strpos($requestedPath, '/');
		if ($nextSlashPos === FALSE) $nextSlashPos = mb_strlen($requestedPath);
		return mb_substr($requestedPath, 0, $nextSlashPos);
	}
1139039
public function first()
    {
        $path = $this->model->getPath('show');

        $this->query->from($path);

        return $this->get()->first();
    }
1229565
protected function parsePath(string $path = null): string
    {
        if ('' === $path || null === $path) {
            return '';
        }

        $path = ltrim($path, '/');

        $path = '*' === $path ? $path : '/' . $path;

        return decode($path);
    }
334207
public function originalPath()
    {
        if (is_int($pos = strpos($this->getParam('REQUEST_URI'), '?'))) {
            return substr($this->getParam('REQUEST_URI'), 0, $pos);
        }
        return substr($this->getParam('REQUEST_URI'), 0);
    }
52742
public function parseURL()
    {
        $breadcrumbs = [];

        // Get the segments
        $path = Request::path();
        $segments = explode('/', $path);

        // Loop through them in blocks of 2: [list, detail]
        $url = $segments[0];
        for ($i=1; $i<count($segments); $i+=2) {

            // If an action URL, you're at the end of the URL
            if (in_array($segments[$i], ['edit'])) {
                break;
            }

            // Figure out the controller given the url partial
            $url .= '/' . $segments[$i];
            $router = new Wildcard($segments[0], 'GET', $url);
            if (!($controller = $router->detectController())) {
                continue;
            }
            $controller = new $controller;

            // Add controller to breadcrumbs
            $breadcrumbs[URL::to($url)] = strip_tags($controller->title(), '<img>');

            // Add a detail if it exists
            if (!isset($segments[$i+1])) {
                break;
            }
            $id = $segments[$i+1];

            // On a "new" page
            if ($id == 'create') {
                $url .= '/' . $id;
                $breadcrumbs[URL::to($url)] = __('decoy::breadcrumbs.new');

            // On an edit page
            } elseif (is_numeric($id)) {
                $url .= '/' . $id;
                $item = $this->find($controller, $id);
                $title = $item->getAdminTitleAttribute();
                $breadcrumbs[URL::to($url.'/edit')] = $title;
            }
        }

        // Return the full list
        return $breadcrumbs;
    }
1291782
public function getHref()
    {
        $uri = $this->getUri();
        
        $fragment = $this->getFragment();       
        if (null !== $fragment) {
            if ('#' == substr($uri, -1)) {
                return $uri . $fragment;
            } else {                
                return $uri . '#' . $fragment;
            }
        }
        
        return $uri;
    }
501237
private function parseNameValue(){

		$index = $this->pos;
		$this->save();


		//$match = $this->MatchReg('/\\G([a-zA-Z\-]+)\s*:\s*((?:\'")?[a-zA-Z0-9\-% \.,!]+?(?:\'")?)\s*([;}])/');
		$match = $this->MatchReg('/\\G([a-zA-Z\-]+)\s*:\s*([\'"]?[#a-zA-Z0-9\-%\.,]+?[\'"]?) *(! *important)?\s*([;}])/');
		if( $match ){

			if( $match[4] == '}' ){
				$this->pos = $index + strlen($match[0])-1;
			}

			if( $match[3] ){
				$match[2] .= ' !important';
			}

			return $this->NewObj4('Less_Tree_NameValue',array( $match[1], $match[2], $index, $this->env->currentFileInfo));
		}

		$this->restore();
	}
595836
public function getStart(): string
    {
        $str = '<' . $this->tag . ' ';
        foreach ($this->attrs as $key => $value) {
            $str .= $key . '="' . $value . '" ';
        }
        $str .= '>';

        return $str;
    }
11213
private static String getPath(String uri) {
        int offset = 0;
        if (uri.startsWith("http://")) {
            offset = "http://".length();
        } else if (uri.startsWith("https://")) {
            offset = "https://".length();
        }

        if (offset == 0) {
            return uri;
        } else {
            int firstSlash = uri.indexOf('/', offset);
            return -1 != firstSlash? uri.substring(firstSlash) : uri;
        }
    }
1120208
public function parseActionName() {
		$uri = trim(get_input('__elgg_uri', ''), '/');
		$segments = explode('/', $uri);
		$handler = array_shift($segments);
		if ($handler == 'action') {
			return implode('/', $segments);
		}
		return $uri;
	}
67732
public function getStopWords()
    {
        $this->initializeStopWordsUrl();
        $response = $this->_sendRawGet($this->_stopWordsUrl);
        return $this->stopWordParser->parseJson($response->getRawResponse());
    }
52079
private function detectFromPath($path)
    {
        if (!$this->usePath) {
            return null;
        }

        $first = \explode('/', \ltrim($path, '/'), 2)[0];
        $first = \strtolower($first);

        if (!empty($first) && \in_array($first, $this->languages, true)) {
            return $first;
        }

        return null;
    }
366686
public function firstPage()
    {
        // return '<a href="'.$this->getUrl().'" class="number" title="1">'.$this->text['first'].'</a>';
        $first = Html::a($this->text['first'], $this->getUrl(1));

        $this->html['first'] = $this->hasListElement($first);

        return $this;
    }
348741
private function getRealLinesBeforeFirstUse(int $firstUsePos, int $posBeforeFirstUse): int
    {
        $file = $this->getFile();
        $whitespaceBeforeFirstUse = '';

        if ($posBeforeFirstUse + 1 !== $firstUsePos) {
            $whitespaceBeforeFirstUse .= TokenHelper::getContent(
                $file,
                $posBeforeFirstUse + 1,
                $firstUsePos - 1
            );
        }

        return substr_count($whitespaceBeforeFirstUse, $file->eolChar) - 1;
    }
246685
public static function getMainNamespaceAndRequest(): string
    {
        if (substr(static::class, 0, strlen(static::BASE_NAMESPACE)) !== static::BASE_NAMESPACE) {
            throw new \Exception("Request must have root namespace of '".static::BASE_NAMESPACE."'");
        }

        return substr(static::class, strlen(static::BASE_NAMESPACE) + 1);
    }
855660
public function getUri(): string
    {
        $uri = '';

        if ( null !== $this->scheme ) {
            $uri .= $this->scheme.':';
        }

        $authority = $this->getAuthority();

        if ( null !== $authority || $this->scheme === 'file' ) {
            $uri .= '//'.$authority;
        }

        $uri .= $this->path;

        if ( null !== $this->query ) {
            $uri .= '?'.$this->query;
        }

        if ( null !== $this->fragment ) {
            $uri .= '#'.$this->fragment;
        }

        return $uri;
    }
1238731
public function FirstLink()
    {
        return HTTP::setGetVar(
            $this->getPaginationGetVar(),
            0,
            ($this->request instanceof HTTPRequest) ? $this->request->getURL(true) : null
        );
    }