37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
|
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
|
-
+
|
m.end.push(m.index + codePos + m[i].length);
} else if (codePos === "$") {
// at the end of the pattern
m.start.push(this.lastIndex - m[i].length);
m.end.push(this.lastIndex);
} else if (codePos === "w") {
// word in the middle of the pattern
iPos = m[0].search("[ ~’,()«»“”]"+m[i]+"[ ,’~()«»“”]") + 1 + m.index
iPos = m[0].search("[ ’,()«»“”]"+m[i]+"[ ,’()«»“”]") + 1 + m.index
m.start.push(iPos);
m.end.push(iPos + m[i].length)
} else if (codePos === "*") {
// anywhere
iPos = m[0].indexOf(m[i]) + m.index;
m.start.push(iPos);
m.end.push(iPos + m[i].length)
|