2 // Converts a pattern in this programs simple notation to a regular expression.
3 // thanks AdBlock! http://www.mozdev.org/source/browse/adblock/adblock/
4 function convert2RegExp( pattern ) {
5 s = new String(pattern);
8 for (var i = 0 ; i < s.length ; i++) {
33 // Remove spaces from URLs.
42 var tldRegExp = new RegExp("^(\\^(?:[^/]*)(?://)?(?:[^/]*))(\\\\\\.tld)((?:/.*)?)$")
43 var tldRes = res.match(tldRegExp);
45 // build the mighty TLD RegExp