Press n or j to go to the next uncovered block, b, p or k for the previous block.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | 21x 1x 1x 1x 4x 1x 1x 1x | import { DecodeContext } from '../decode'; const FLAGS = ['g', 'i', 'm', 'y']; export function decodeRegExp(context: DecodeContext): RegExp { const { reader, links } = context; const pattern = reader.readString(); const flags = reader.readFlags(4); const flagsString = flags.map((flag, i) => (flag ? FLAGS[i] : '')).join(''); const regexp = new RegExp(pattern, flagsString); links.push(regexp); return regexp; } |