Earlier quoted context omitted.
Try asking code-davinci-002 instead of text-davinci-003. curl https://api.openai.com/v1/completions \ -H "Content-Type: application/json" \ -H "Authorization: Bearer $OPENAI_API_KEY" \ -d '{ "model": "code-davinci-002", "prompt": "##### Create a regular expression to match words starting with 'dog' or ending with 'cat'.\n \n### Java Code", "temperature": 0, "max_tokens": 182, "top_p": 1, "frequency_penalty": 0, "pres…
Pretty sure that regexp is wrong though? Wouldn’t having ‘\b’ on both sides match beginning AND end? It’s got the parenthesis for the ‘|’ in the wrong place.
https://regex101.com/r/ZNQa9X/1
The generated regex is the same as
(\bdog\b)|(\bcat\b)
https://regex101.com/r/vTtEU4/1I’m currently trying to figure out how to match a word starting with dog without using
\bdog.*
because .*
would proceed to eat the rest of the line.So I was thinking I could say
\bdog[^\b]*
But that doesn’t work, it also ends up eating the rest of the line as well.