Reputation: 919
I have a typical hostname router as follows :
$route = Hostname::factory(array(
'route' => ':subdomain.domain.tld',
'constraints' => array(
'subdomain' => '??regex??',
)
));
The problem is that I want to match all the subdomains except 'www'.In other words this router should handle all the subdomains but www.domain.tld. I tried different regex solutions without success. What's the right regex to achieve this ?
Some of the regex solutions I used :
Upvotes: 1
Views: 102
Reputation: 174836
You may try the below regex.
'^(?!www).*'
This won't allow www
at the start.
Upvotes: 1