// 列出 u665(字段说明)中全部字段编号+名称,核对省略段是否还有客户相关字段 import fs from 'node:fs'; const html = fs.readFileSync('e:/code/crm-backend-matt/.scratch/lanhu-latest/v29-customer-pages/a3-1-1-2-1_raw.html', 'utf8'); const decode = (s) => s.replace(/&#x([0-9A-Fa-f]+);/g, (_, h) => String.fromCodePoint(parseInt(h, 16))); const m = html.match(/
\s*<\/div>/); if (!m) { console.log('NOT FOUND'); process.exit(0); } const paras = (m[0].match(/

]*>[\s\S]*?<\/span><\/p>/g) || []) .map(p => decode(p.replace(/<\/?p>/g, '').replace(/<\/?span[^>]*>/g, '')).trim()); let cur = null; for (const p of paras) { const fm = p.match(/^(\d+)\.\s*(.+)$/); if (fm) { cur = fm[1] + '. ' + fm[2]; console.log(cur); } else if (cur && p.length > 0 && !p.startsWith(' ')) { console.log(' ' + p.slice(0, 80)); } }