RE: [PHP] Regex Lookbehind help

From: Date: Tue, 26 Oct 2004 18:57:15 +0000
Subject: RE: [PHP] Regex Lookbehind help
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-200381@lists.php.net to get a copy of this message
Alex Hogan wrote: > Hi All, > > I am trying to identify an email address in a page but I don't want to > return the email if it's webmaster@whatever.com. > > Here's what I have; > (\w[-._\w]*\w(?<!webmaster)@\w[-._\w]*\w\.\w{2,3}) > > It returns nothing, however when I take out the lookbehind section; > (\w[-._\w]*\w@\w[-._\w]*\w\.\w{2,3}) > it works fine, returning all email addresses in a page. > > What is wrong with my syntax? I just tried this out and the first regex is actually working for me on php 4.3.8 (cli). Can you post some code?

« previous php.general (#200381) next »