Skip to content

Add option to use regular expressions in find popup#230

Open
max-nothacker wants to merge 1 commit into
zotero:masterfrom
max-nothacker:find-regex
Open

Add option to use regular expressions in find popup#230
max-nothacker wants to merge 1 commit into
zotero:masterfrom
max-nothacker:find-regex

Conversation

@max-nothacker

@max-nothacker max-nothacker commented Jul 7, 2026

Copy link
Copy Markdown

Adds a "Use regular expressions" toggle to the find popup, for PDF, EPUB, and snapshot views.

Requested on the forums: Feature Request: Support Content Search with Regex and another user request.

  • New useRegex find option alongside the existing case-sensitive/whole-words options
  • PDF: regex matching in pdf-find-controller; EPUB/snapshot: in the DOM find worker
  • Work is bounded for broad patterns (e.g. . while composing a pattern): total-match cap set to 5000, snippet generation tokenizes a window around the match instead of the whole page, and single-letter patterns don't auto-search consistent with the pre-existing search behavior that already ignored single-letter patterns before this PR.
  • Invalid patterns are rejected consistently across both engines instead of searching

Needed by: zotero/zotero#5993, which carries the localized string and 13 find tests (PDF, EPUB, snapshot).

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

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant