UNPKG

onelang

Version:

OneLang transpiler framework core

9 lines (8 loc) 293 B
export class Regex { static matchFromIndex(pattern: string, input: string, offset: number) { const regex = new RegExp(pattern, "gy"); regex.lastIndex = offset; const matches = regex.exec(input); return matches === null ? null : Array.from(matches); } }