[Project_owners] RE: Top 50 regexp

massey massey at stlouis-shopper.com
Tue Jul 22 15:58:57 EDT 2003


The regexp:
 next if /downloads\.(.*?)mozdev\.org/;

Will always be true if 'downloads.' is matched because $1 is now not equal to null. The ' .*? ' will consume the rest of the line, greedily, plus the last character.

I assume the match in question is looking for something like:
' downloads.mirror1.mozdev.org ' 
if so the expression /downloads(\.[a-z]+[0-9]+)\.mozdev\.org/ may be better as it is looking for only alpha and/or num class as in ' mirror1 ' and if it does not find a match it fails.

Just an expression of my 2 cents

Jim





More information about the Project_owners mailing list