This has been observed by more people than just Terence Tao. Try using chatgpt to program something of higher complexity than tutorial code or write a basic blog post, it lacks creativity and the code is poorly designed.
It doesn't really get logic still, but it does small edits well when the code is very clear.
I think this will always remain a problem. Because it can never shut up, it keeps making stuff up and "hallucinate" (works normally, just incorrectly) to dig itself further and further into a hole.
Autocomplete on steroids is what peak AI will look like till the time we can crack consciousness and AGI (which the modern versions are nothing even close to).
fn parse_image_url(html: &str) -> Option<String> {
let re = regex::Regex::new(r#"src="([^"]+)""#).ok()?;
re.captures(html)
.and_then(|caps| caps.get(1))
.map(|m| m.as_str().to_string())
}
Prompt was "write a function which extracts image urls from a given block of html"