View Single Post
Old 11-16-2023, 06:13 PM   #8
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 8,860
Karma: 6120478
Join Date: Nov 2009
Device: many
Ah! Your use of ? to indicate Minimal Match (non-greedy) will actually *invert* the Greediness of the Minimal Match Regex Option. The Text flag needs its part to default to greedy.

Try replacing the smart quote at the end of "entire." with a normal quote and then remove the ? that toggles the initial Text only regex to be nongreedy.

ie. use "(.*)"

and then make sure the Minimal Match and DotAll are both set in the Regex options and make sure the Text box is checked.

That seems to work.

But using a real parser or the Smarten plugin is probably your best bet here as corner cases will be found.

If you do decide to use Search and replace and regex, you should first do a Dry Run using Shift key on the Count (#) button or better yet use Shift on the Replace All button to see a complete table of the potential replacements and allow you to remove any corner cases (filter those changes out) before proceeding.

Both Dry Run Replace All and Filtered Replace All are newer Find and Replace tools that really help in situations where unspecified corner cases may exist.

Give them a try.

Additionally, making a Checkpoint would not hurt either.

Last edited by KevinH; 11-16-2023 at 06:39 PM.
KevinH is offline   Reply With Quote