Skip to content

jc3213/matchpattern.js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 

Repository files navigation

matchpattern.js

Usage

Lastest Extension
matchpattern.js Easy Proxy

HTML

<script src="https://jc3213.github.io/matchpattern.js/matchpattern.js"></script>

TamperMonkey

// @require https://jc3213.github.io/matchpattern.js/matchpattern.js

Syntax

let match = new MatchPattern(); // requires v0.4~
match.proxy = 'SOCKS 127.0.0.1:1080';

Properties

data

  • array
  • read only
let { data } = match;

pacScript

  • string
  • read only
let { pacScript } = match;

Method

new

match.new(string[]);

add

match.add(string | string[]);

delete

match.delete(string | string[]);

clear

match.clear();

test

let result = match.test(string);

Static Properties

caches

  • Map
  • readonly
let { caches } = MatchPattern;

pacScript

  • string
  • read only
let { pacScript } = match;

Static Method

test

let result = MatchPattern.test(string);

make

let rule = MatchPattern.make(string);

delete

MatchPattern.delete(string | string[]);

MatchPattern

  • example.com
    • Matches www.example.com, example.com
    • Doesn't Match test-example.com, www.example.com.cn
Match Pattern ↓ www.youtube.com www.facebook.net x.com telegram.org
*
youtube.com
facebook.com
x.com
com
org
youtube
telegram

About

A Javascript library that manages mach patterns for matching urls

Topics

Resources

License

Stars

Watchers

Forks