Build, test, and debug regular expressions
This regular expression is designed to extract HTML heading tags (from `<h1>` to `<h9>`) and their inner text. It attempts to account for potential attributes like `id` within the opening tag and match the corresponding closing tag. It is typically used in web scraping or data extraction tasks to pull titles and section headers from HTML documents.