You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
10 lines
300 B
10 lines
300 B
function indexOfMatchEnd(xml, pattern, startIndex) {
|
|
const re = new RegExp(pattern);
|
|
const match = re.exec(xml.slice(startIndex));
|
|
if (match) return startIndex + match.index + match[0].length - 1;
|
|
else return -1;
|
|
}
|
|
|
|
module.exports = indexOfMatchEnd;
|
|
module.exports.default = indexOfMatchEnd;
|