On Tue, 2010-04-13 at 13:05 -0400, Charles Gregory wrote:
> On Tue, 13 Apr 2010, Martin Gregorie wrote:
> > header FROM_STARTS_WITH_NUMS From =~ /\d{6,}[a-z._-][a-z0-9._-]{0,50}@/i
> 
> This regex requires that the 7th character be non-numeric.
>
Nope - only that a character after the first six is a legal address
character but non-numeric. I did it this way because I wanted the 7th
char to be explicitly any legal address character that is not a digit
and all further characters up to the @ to  be legal address characters:
\S is a wider match than that.

> Look at the regex I posted.... It covers all cases with six leading 
> digits that is not a purely numeric address.
> 
> /^\d{6,}\S*[^\s\d]\S*@/
> 
The two regexes produce identical results on my test data provided I
remove your leading '^'. I've since added test cases to explore more
than 6 leading spaces, e.g. 1234567-888999
 
Martin


Reply via email to