in reply to Regexp match start or end
One approach I've found works well is telling chatgpt to respond in json or yaml, and defining a format where it has space to express itself as "comments". It's pretty reliable if it's a system instruction and you provide some examples. I bet XML would work well too.
In Section
Seekers of Perl Wisdom