[Greasemonkey] Control over metadata include/exclude regular expressions

Matthias Bauer ml-greasemonkey-42imk83y at moeffju.net
Sat Dec 10 02:48:55 EST 2005


On 08.12.2005 03:56 Bill Donnelly wrote:

> I think it would be a pain to have the regex enclosed
> in slashes because any slashes in the URL would have
> to be backslash-quoted. Think of it as a string regex
> without the quotes. Which is actually how it is used --
> the function return is: return new RegExp (sNewRegEx, "i")
> This stops us from being able to supply regex flags,
> but I don't think we need to. And insensitive search
> should probably always be used.
> 
> I added the requirement that TLD needs to be specified
> to be used by appending "\TLD" at the end of the regex.
> So it searches for "$\TLD", and then removes the "\TLD"
> and allows it to run through the TLD processing. This is
> only for complex-type regex's. Simple always check for TLD.

Just make it like AdBlock. If the strings begins with / and ends with
/[modifiers], treat it as a regex. Since URLs can't start with /, and
subdirs are matched by */directory/*, there shouldn't be conflicts.

I like the idea of a /T flag to enable TLD magic. Wouldn't want to put
that huge TLD-regex in manually everytime.

-M


More information about the Greasemonkey mailing list