Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Did you try Expert mode?


Btw 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}`);
  }


Same 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




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: