aboutsummaryrefslogtreecommitdiffstats
path: root/src/selector/filterMatchExpr.js
blob: 17056a555214f1e1b95bac7b67860be91ef4ca54 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
import whitespace from "../var/whitespace.js";
import identifier from "./var/identifier.js";
import attributes from "./var/attributes.js";
import pseudos from "./var/pseudos.js";

var filterMatchExpr = {
	ID: new RegExp( "^#(" + identifier + ")" ),
	CLASS: new RegExp( "^\\.(" + identifier + ")" ),
	TAG: new RegExp( "^(" + identifier + "|[*])" ),
	ATTR: new RegExp( "^" + attributes ),
	PSEUDO: new RegExp( "^" + pseudos ),
	CHILD: new RegExp(
		"^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" +
		whitespace + "*(even|odd|(([+-]|)(\\d*)n|)" + whitespace + "*(?:([+-]|)" +
		whitespace + "*(\\d+)|))" + whitespace + "*\\)|)", "i" )
};

export default filterMatchExpr;