[Greasemonkey] Control over metadata include/exclude regular
expressions
Matt Sargent
matt.sargent at earthlink.net
Thu Dec 8 09:06:47 EST 2005
Everyone seems to be missing the obvious solution: Instead of trying to make
@include/@exclude do double-duty, just create new meta-tags for regex
expressions. @rxinclude and @rxexclude, for example.
On 8 Dec 2005 at 1:13, Bill Donnelly wrote:
> Nevermind.
>
> A 'simple' regex of /adirectory/ doesn't make sense because
> it will be converted into ^/adirectory/$, which isn't valid.
> (Gm-metadata-URL-wise)
> (it would need to be: */adirectory/*, which becomes:
> ^.*/adirectory/.*$)
>
> So it is safe to use both an "^" and a "/" as a first character
> to specify 'complex' regular expressions.
>
> So I made it now support both types of 'complex' regex's.
>
> 1) ^.....$[\TLD]
>
> 2) /...../[iT]
>
> Where items in [] are optional. On the second version, it you don't
> specify a flag, it defaults to "i". (as usual ==> ignore case) The T
> flag MUST be capitalized and is special for TLD support.
>
> While I was at it, I added "**" to simple regex, which is
> translated to ".+" (one or more characters, where ".*" means zero or
> more)
>
> I tested it, so it should be fine.
>
>
More information about the Greasemonkey
mailing list