src/Common/Service/Locale.php
public function getUrlRegex(): string
    {
        $aSupportedLocales = $this->getSupportedLocales();
        $aUrlLocales       = [];

        foreach ($aSupportedLocales as $oLocale) {
            $sVanity       = $this->getUrlSegment($oLocale);
            $aUrlLocales[] = $sVanity;
        }

        return '/^(' . implode('|', array_filter($aUrlLocales)) . ')?(\/)?(.*)$/';
    }
public function getUrlRegex(): string
    {
        $aSupportedLocales = $this->getSupportedLocales();
        $aUrlLocales       = [];

        foreach ($aSupportedLocales as $oLocale) {
            $sVanity       = $this->getUrlSegment($oLocale);
            $aUrlLocales[] = $sVanity;
        }

        return '/^(' . implode('|', array_filter($aUrlLocales)) . ')?(\/)?(.*)$/';
    }
public function getUrlRegex ( ) : string { $ aSupportedLocales = $ this -> getSupportedLocales ( ) ; $ aUrlLocales = [ ] ; foreach ( $ aSupportedLocales as $ oLocale ) { $ sVanity = $ this -> getUrlSegment ( $ oLocale ) ; $ aUrlLocales [ ] = $ sVanity ; } return '/^(' . implode ( '|' , array_filter ( $ aUrlLocales ) ) . ')?(\/)?(.*)$/' ; }
Returns a regex suitable for detecting a language flag at the beginning of the URL

@return string
Returns a regex suitable for detecting a language flag at the beginning of the URL