<script src="https://jc3213.github.io/matchpattern.js/matchpattern.js"></script>
// @require https://jc3213.github.io/matchpattern.js/matchpattern.js
let match = new MatchPattern();
match.proxy = 'SOCKS 127.0.0.1:1080';
match.add("www.example.com"); // *.example.com
match.remove('*.example.com');
match.clear();
let result = MatchPattern.make('www.microsoft.com'); // *.microsoft.com
let merged = MatchPattern.merge();
let regexp = merged.regexp;
let pac_script = merged.pac_script;
MatchPattern.erase('SOCKS 127.0.0.1:1080');
MatchPattern.erase('SOCKS 127.0.0.1:1080', 'HTTPS 127.0.0.1:6780');
MatchPattern.erase( ['SOCKS 127.0.0.1:1080', 'HTTPS 127.0.0.1:6780'] );
*.example.com
- Matches
www.example.com
,example.com
- Doesn't Match
test-example.com
,www.example.com.cn
- Matches
example.*
- Matches
example.com
,example.co.uk
- Doesen't Match
www.example.com
,example-test.com
- Matches
Match Pattern | Target Hostname |
---|---|
<all-urls> | All hostnames |
www.university.org.eu *.university.org.eu *.org.eu |
www.university.org.eu |
doc.university.org.eu doc.university.org.* doc.university.* |
doc.university.org.eu |
192.168.1.* 192.168.* 192.* |
192.168.1.1 |