On 10/05/2011 10:06 AM, T Elcor wrote: > --- On Wed, 10/5/11, Darac Marjal <mailingl...@darac.org.uk> wrote: > >>> Is there a way to write a single Javascript regex that >> would match all of the following three patterns: >>> a.domain.tld >>> b.domain.tld >>> domain.tld/c/ >>> >> >> /.*/ >> >> Or, perhaps you're after /domain.tld/ >> >> Either should work, though I'd expect the first to be >> quicker in your case. > No, this isn't what I'm looking for. I'm not after blocking everything or the > whole domain.tld, only the three above URI patterns. > > I came across this trying to rewrite my ad blocking list in a more elegant > way, but couldn't see any obvious way to make it with one regex without > blocking more than necessary.
Well, you didn't say you wanted _only_ that to match. ^(a\.)?domain\.tld(\/c\/)?$ JavaScript syntax might be slightly different, but that's the idea. -- All generalisations are dangerous, including this one. Eduardo M KALINOWSKI edua...@kalinowski.com.br -- To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org Archive: http://lists.debian.org/4e8c58dc.7020...@kalinowski.com.br