Skip to content

Skip unmatched main capture groups in page searches - #1399

Open
jakezwang wants to merge 1 commit into
jsvine:developfrom
jakezwang:fix/search-unmatched-main-group
Open

jakezwang wants to merge 1 commit into
jsvine:developfrom
jakezwang:fix/search-unmatched-main-group

Conversation

@jakezwang

Copy link
Copy Markdown

Page.search(..., main_group=1) raises AttributeError when that capture group does not participate in a match. Treat missing group contents as empty so they are skipped alongside existing empty and whitespace-only results.

Adds regressions for optional groups and alternations, including preservation of valid matches, coordinates, and characters. Updates the changelog and contributor list as requested.

Validation: 175 tests passed on both Python 3.10 and 3.14, including repair tests with Ghostscript. make lint and sdist/wheel builds passed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant