Re: [PHP-DB] Easy reg expression problem

2004-07-16 Thread Jason Wong
On Friday 16 July 2004 16:01, Tim Van Wassenhove wrote: > In article <[EMAIL PROTECTED]>, Jason Wong wrote: > > On Friday 16 July 2004 08:05, Justin Patrin wrote: > >> > If you're simply trying to get '@email.com' then use strstr(). > >> > >> Of courseI'm just so used to pregs... > > > > Well t

Re: [PHP-DB] Easy reg expression problem

2004-07-16 Thread Tim Van Wassenhove
In article <[EMAIL PROTECTED]>, Jason Wong wrote: > On Friday 16 July 2004 08:05, Justin Patrin wrote: > >> > If you're simply trying to get '@email.com' then use strstr(). >> >> Of courseI'm just so used to pregs... > > Well the advantage of using a regex is that you can perform some form of

Re: [PHP-DB] Easy reg expression problem

2004-07-15 Thread Jason Wong
On Friday 16 July 2004 08:05, Justin Patrin wrote: > > If you're simply trying to get '@email.com' then use strstr(). > > Of courseI'm just so used to pregs... Well the advantage of using a regex is that you can perform some form of validation on the address. -- Jason Wong -> Gremlins Asso

Re: [PHP-DB] Easy reg expression problem

2004-07-15 Thread Justin Patrin
On Fri, 16 Jul 2004 08:02:17 +0800, Jason Wong <[EMAIL PROTECTED]> wrote: > On Friday 16 July 2004 07:43, ioannes wrote: > > I am trying to work out how to isolate the bit after and including the @ in > > an email address using php. I would be grateful if someone could point me > > to the expressi

Re: [PHP-DB] Easy reg expression problem

2004-07-15 Thread Jason Wong
On Friday 16 July 2004 07:43, ioannes wrote: > I am trying to work out how to isolate the bit after and including the @ in > an email address using php. I would be grateful if someone could point me > to the expression. > > $email="[EMAIL PROTECTED]"; > ereg("([a-zA-Z0-9])@([a-zA-Z0-9]).([a-zA-Z0-

Re: [PHP-DB] Easy reg expression problem

2004-07-15 Thread Justin Patrin
Well, I always use Perl Regexes instead of eregs. preg_match('/$(.*?)(@.*)^/', $email, $matches); $beforeAt = $matches[1]; $afterAndIncludingAt = $matches[2]; On Fri, 16 Jul 2004 00:43:46 +0100, ioannes <[EMAIL PROTECTED]> wrote: > I am trying to work out how to isolate the bit after and includin

[PHP-DB] Easy reg expression problem

2004-07-15 Thread ioannes
I am trying to work out how to isolate the bit after and including the @ in an email address using php. I would be grateful if someone could point me to the expression. $email="[EMAIL PROTECTED]"; ereg("([a-zA-Z0-9])@([a-zA-Z0-9]).([a-zA-Z0-9]))", $email, $regs); print("@".$regs[1].$regs[2].$regs