app/code/community/Nexcessnet/Turpentine/Model/Varnish/Configurator/Abstract.php
public function getAllowedHostsRegex() {
        $hosts = array();
        foreach (Mage::app()->getStores() as $store) {
            $hosts[] = parse_url($store->getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB, false), PHP_URL_HOST);
        }

        $hosts = array_values(array_unique($hosts));

        $pattern = '('.implode('|', array_map("preg_quote", $hosts)).')';
        return $pattern;
    }
public function getAllowedHostsRegex() {
        $hosts = array();
        foreach (Mage::app()->getStores() as $store) {
            $hosts[] = parse_url($store->getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB, false), PHP_URL_HOST);
        }

        $hosts = array_values(array_unique($hosts));

        $pattern = '('.implode('|', array_map("preg_quote", $hosts)).')';
        return $pattern;
    }
public function getAllowedHostsRegex ( ) { $ hosts = array ( ) ; foreach ( Mage :: app ( ) -> getStores ( ) as $ store ) { $ hosts [ ] = parse_url ( $ store -> getBaseUrl ( Mage_Core_Model_Store :: URL_TYPE_WEB , false ) , PHP_URL_HOST ) ; } $ hosts = array_values ( array_unique ( $ hosts ) ) ; $ pattern = '(' . implode ( '|' , array_map ( "preg_quote" , $ hosts ) ) . ')' ; return $ pattern ; }
Get hosts as regex

ex: base_url: example.com
path_regex: (example.com|example.net)

@return string
Get hosts as regex