Skip to content

Improve Scanno regex & fix bug in S/R replacement#1740

Merged
windymilla merged 1 commit intoDistributedProofreaders:masterfrom
windymilla:stealth-scanno
Feb 24, 2026
Merged

Improve Scanno regex & fix bug in S/R replacement#1740
windymilla merged 1 commit intoDistributedProofreaders:masterfrom
windymilla:stealth-scanno

Conversation

@windymilla
Copy link
Collaborator

If regex had nested lookahead/lookbehind at the end of the string, the code failed to remove it properly, so the replacement didn't work.

Also, stealth scanno regexes 18 & 19 were wrong - they matched the correct string, but didn't fix them correctly.

And the original purpose of the work - regex 18 now doesn't match if the line below is actually lowercase markup for poetry, center, etc., e.g. p/

If regex had nested lookahead/lookbehind at the end of the
string, the code failed to remove it properly, so the
replacement didn't work.

Also, stealth scanno regexes 18 & 19 were wrong - they
matched the correct string, but didn't fix them correctly.

And the original purpose of the work - regex 18 now
doesn't match if the line below is actually lowercase
markup for poetry, center, etc., e.g. `p/`
@windymilla windymilla requested a review from srjfoo February 23, 2026 20:39
@windymilla
Copy link
Collaborator Author

Testing notes:

Example file:

/p
It totters when. she licks it with her tongue.
It sha'n't be gone long.--You come too.
p/

/r
Robert Frost.
z/
  1. In master regexes 18 & 19 will find the incorrect commas/periods, but will not correct them properly
  2. In this branch, regex 18 should only find "Frost.", not "too." (because it's followed by p/
  3. Also in this branch, the replacement should work

@windymilla windymilla merged commit 4ab70c4 into DistributedProofreaders:master Feb 24, 2026
1 check passed
@windymilla windymilla deleted the stealth-scanno branch February 24, 2026 11:05
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.

2 participants