1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
|
!(function (a) {
var e = { pattern: /\\[\\(){}[\]^$+*?|.]/, alias: 'escape' },
n =
/\\(?:x[\da-fA-F]{2}|u[\da-fA-F]{4}|u\{[\da-fA-F]+\}|0[0-7]{0,2}|[123][0-7]{2}|c[a-zA-Z]|.)/,
t = '(?:[^\\\\-]|' + n.source + ')',
s = RegExp(t + '-' + t),
i = { pattern: /(<|')[^<>']+(?=[>']$)/, lookbehind: !0, alias: 'variable' };
a.languages.regex = {
'char-class': {
pattern: /((?:^|[^\\])(?:\\\\)*)\[(?:[^\\\]]|\\[\s\S])*\]/,
lookbehind: !0,
inside: {
'char-class-negation': {
pattern: /(^\[)\^/,
lookbehind: !0,
alias: 'operator',
},
'char-class-punctuation': { pattern: /^\[|\]$/, alias: 'punctuation' },
range: {
pattern: s,
inside: {
escape: n,
'range-punctuation': { pattern: /-/, alias: 'operator' },
},
},
'special-escape': e,
'char-set': { pattern: /\\[wsd]|\\p\{[^{}]+\}/i, alias: 'class-name' },
escape: n,
},
},
'special-escape': e,
'char-set': { pattern: /\.|\\[wsd]|\\p\{[^{}]+\}/i, alias: 'class-name' },
backreference: [
{ pattern: /\\(?![123][0-7]{2})[1-9]/, alias: 'keyword' },
{
pattern: /\\k<[^<>']+>/,
alias: 'keyword',
inside: { 'group-name': i },
},
],
anchor: { pattern: /[$^]|\\[ABbGZz]/, alias: 'function' },
escape: n,
group: [
{
pattern:
/\((?:\?(?:<[^<>']+>|'[^<>']+'|[>:]|<?[=!]|[idmnsuxU]+(?:-[idmnsuxU]+)?:?))?/,
alias: 'punctuation',
inside: { 'group-name': i },
},
{ pattern: /\)/, alias: 'punctuation' },
],
quantifier: { pattern: /(?:[+*?]|\{\d+(?:,\d*)?\})[?+]?/, alias: 'number' },
alternation: { pattern: /\|/, alias: 'keyword' },
};
})(Prism);
|