- Original Message -----
From: "Jim Lucas"
To: "Red"
Cc:
Sent: Friday, October 30, 2009 12:33 AM
Subject: Re: [PHP] please help with regular expression in preg_replace
Red wrote:
hello, im not a php developer, i just need to rewrite one php file but
having
Red wrote:
> hello, im not a php developer, i just need to rewrite one php file but having
> problem with understanding syntax of regexp in php.
>
> i need to get domain name from fqdn (for example from $_SERVER['HTTP_HOST'] )
>
> in sed its working well with "s/[^.]*\.//" , but preg_replace beh
Hi Rene,
This looks suspiciously like regex's "greedy" behaviour - it will
gobble up everything that matches until you tell it otherwise.
For example, your regex is matching "any character that isn't a dot,
followed by a dot."
In host.domain.com, both "host." and "domain." match this rege
3 matches
Mail list logo