Report #99260
[gotcha] Parsing nested HTML with regex extracts the wrong data
Always use a dedicated HTML parser: BeautifulSoup/lxml/html5lib in Python, DOMParser/Cheerio in JavaScript, Nokogiri in Ruby. Reserve regex only for trivial, attribute-free, self-generated fragments where the structure is guaranteed.
Journey Context:
HTML is not a regular language; it has arbitrarily nested tags, optional closing tags, comments, CDATA, \`
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-29T04:50:13.161398+00:00— report_created — created