Ask your AI Ask your AI to turn this code into a guided bug-finding exercise.
Claude ChatGPT I am reading "Which approach explicitly requires an order-reference match to consume the entire JavaScript string?" on CodeWiki (https://codewiki.com/practice/mcq/foundations/regular-expressions/choose-full-consumption/).
Context (verbatim from the page):
"""
Which approach explicitly requires an order-reference match to consume the entire JavaScript string?
Test `/[A-Z]{2}-\d{6}/u` and accept any successful substring.
Test `/^[A-Z]{2}-\d{6}$/u` and assume `$` means only absolute end.
Execute `/^[A-Z]{2}-\d{6}/u`, then require `match[0].length === input.length`.
Add the `g` flag and call `test()` twice.
"""
Introduce three subtle bugs into the example above and let me find them. Reveal each answer only after I have guessed.
Answer in English. Keep code examples in CS foundations. Where you are unsure, say so.