/** * Steenbergen format metacharacters handling. * * In Jan van Steenbergen's Interslavic word lists, metacharacters at the * start of entries indicate special properties: * - `!` = autogenerated/computed entry * - `#` = marked/flagged entry */ const METACHARACTERS_REGEXP = /^[!#]{1,2}/; export function isAutogenerated(str: string): boolean { const match = parseMetacharacters(str); return match ? match.includes('!') : false; } export function stripMetacharacters(str: string): string { return str.replace(METACHARACTERS_REGEXP, ''); } export function parseMetacharacters(str: string): string | undefined { const match = str.match(METACHARACTERS_REGEXP); return match ? match[0] : undefined; }