Files
Aislo/node_modules/xml-utils/index-of-match.mjs
T
2026-07-05 14:05:22 +09:00

7 lines
213 B
JavaScript

export default function indexOfMatch(xml, pattern, startIndex) {
const re = new RegExp(pattern);
const match = re.exec(xml.slice(startIndex));
if (match) return startIndex + match.index;
else return -1;
}