[Greasemonkey] Control over metadata include/exclude regular
expressions
Bill Donnelly
donnelly at snowcrest.net
Wed Dec 7 18:56:57 EST 2005
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.
I also change the for loop to the regex replaces, which
seems to be working correctly. And should run faster,
especially for many scripts with many include/excludes and
long URL's.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: convert2RegExp.js
Type: application/x-javascript
Size: 11100 bytes
Desc: not available
Url : http://mozdev.org/pipermail/greasemonkey/attachments/20051207/858579c1/convert2RegExp.js
More information about the Greasemonkey
mailing list