<script src="https://jc3213.github.io/matchpattern.js/matchpattern.js"></script>
// @require https://jc3213.github.io/matchpattern.js/matchpattern.js
let matchPattern = new MatchPattern();
- add
- add new match pattern
- remove
- remove exist match pattern
- match
- match
url
with match patterns
- match
matchPattern.add('*.google.com');
- add
*.google.com
to match patterns
matchPattern.remove('*.github.com');
- remove
*.github.com
from match patterns - if
*.github.com
is not in match patterns, do nothing
matchPattern.match('https://www.bing.com/'); // false
- match
https://www.bing.com/
with match patterns - returns
false
, if not match pattern is added
Target Hostname | Valid Match Pattern |
---|---|
www.university.org.eu | www.university.org.eu *.university.org.eu *.org.eu |
doc.university.org.eu | doc.university.org.eu doc.university.* doc.university* |
user.university.org.eu | *.user.university.org.eu *.university.org.eu *university.org.eu |