On Fri, 2011-02-18 at 15:01 -0800, Adam Katz wrote: > > > uri __TD_DOT_INFO m'^http://[^/]*\.info[/:?#]'i > > On 02/18/2011 02:55 PM, Karsten Bräckelmann wrote: > > Way better. And actually a uri rule. :) It's missing a bare domain URI, > > though. The "end of the domain part" sub-RE alternatively should accept > > the end of the string. > > > > / ... \.info(?:[/:?#]|$)/ > > If you're going to nit-pick, I'll correct its other minor bugs too:
Hey, I was not nit-picking! Merely increasing the expected performance of that uri rule substantially. ;) > header __TD_DEB_LIST List-Id =~ /<debian-user\.lists\.debian\.org>/ > uri __TD_DOT_INFO m'^http://[^/:?#]*\.info(?:[/:?#]|$)'i > > :-p Ah, good one. Though unfortunately, and I hate to admit that, both our rules will never match. The # hash needs to be escaped... *sigh* [/:?\#] Or just ignore it by leaving it out. It's pretty rare, anyway. -- char *t="\10pse\0r\0dtu\0.@ghno\x4e\xc8\x79\xf4\xab\x51\x8a\x10\xf4\xf4\xc4"; main(){ char h,m=h=*t++,*x=t+2*h,c,i,l=*x,s=0; for (i=0;i<l;i++){ i%8? c<<=1: (c=*++x); c&128 && (s+=h); if (!(h>>=1)||!t[s+h]){ putchar(t[s]);h=m;s=0; }}}