Files
oldboy/scripts/csound-parser/debug-section.ts
2025-10-15 15:05:23 +02:00

31 lines
1015 B
TypeScript

import * as fs from 'fs';
const content = fs.readFileSync('downloaded-opcodes/moogladder.md', 'utf-8');
console.log('Full content length:', content.length);
console.log('\n=== Testing extractSection regex ===\n');
const regex = /##\s+Syntax\s*\n([\s\S]*?)(?=\n##|$)/i;
const match = content.match(regex);
if (match) {
console.log('Match found!');
console.log('Captured content length:', match[1].length);
console.log('\nFull captured content:');
console.log('---START---');
console.log(match[1]);
console.log('---END---');
} else {
console.log('No match found');
}
// Also check what comes after
const syntaxIndex = content.indexOf('## Syntax');
const examplesIndex = content.indexOf('## Examples');
console.log('\n=== Indices ===');
console.log('## Syntax at:', syntaxIndex);
console.log('## Examples at:', examplesIndex);
console.log('Distance:', examplesIndex - syntaxIndex);
console.log('\nContent between (first 500 chars):');
console.log(content.substring(syntaxIndex, syntaxIndex + 500));