3 ms·
Did you try Expert mode?
by rushingcreek 4y ago
Did you try Expert mode?
- weird-eye-issue 4y agoSame problem For some reason this seems to be trained deep into the GPT model. Even when you tell it in the prompt it doesn't exist sometimes it will contradict itself. That's why it can be an interesting test case
- weird-eye-issue 4y agoBtw it does some weird escaping for JavaScript string literals, also the regex was wrong: const htmlString = '<img src="image1.jpg" alt="Image 1"><img src="image2.jpg">'; const regex = /<img\s[^>]*?src\s*=\s*['"]([^'"]+?)['"][^>]*?(?:alt\s*=\s*['"]([^'"]*?)['"])?[^>]*?>/gi; let match; while ((match = regex.exec(htmlString)) !== null) { const src = match[1]; const alt = match[2] || null; console.log(`src: \${src}, alt: \${alt}`); }