* Search and Replace (date replacement)

For users to report plugin bugs and request plugin enhancements; and for authors to test new/new versions of plugins, and to discuss plugin development (in the Programming Technicalities sub-forum). If you want advice on choosing or using a plugin, please ask in General Usage or an appropriate sub-forum.
Post Reply
User avatar
Jane
Site Admin
Posts: 8442
Joined: 01 Nov 2002 15:00
Family Historian: V7
Location: Somerset, England
Contact:

Search and Replace (date replacement)

Post by Jane » 07 Jun 2014 08:13

When working with Derek I found a slight problem with the date replace when working with date phrases. The dates had & in them and were wrapped with double quotes, I wanted to replace the & and then remove the double quotes, but could not as the first replacement produced a phrase and the plugin wanted to prompt each one.

I wonder if it might be worth adding an option to clear all quotation marks from date fields when doing and replacements on them?
Jane
My Family History : My Photography "Knowledge is knowing that a tomato is a fruit. Wisdom is not putting it in a fruit salad."

User avatar
tatewise
Megastar
Posts: 27087
Joined: 25 May 2010 11:00
Family Historian: V7
Location: Torbay, Devon, UK
Contact:

Re: Search and Replace (date replacement)

Post by tatewise » 07 Jun 2014 10:55

As I posted in that other thread, the following that worked for the user:
Search: "(.*)&(.*)"
Replace: %1AND%2
with LUA Pattern Mode

However, I realise this is not an obvious workaround, because it relies on a deep understanding of LUA Patterns.

I recognise that users may wish to make global changes to Date Phrases and it is an oversight that the Plugin prevents that.

Unfortunately, simply removing the string quotes from Date Phrases does not work when ...interpreted as is chosen, because the interpreted Date becomes incorporated into the Date Phrase.
Also, it is perhaps possible that a user wants to retain a Date Phrase that just happens to be a valid Date format.

I have two proposals, but I prefer the first one as it is more explicit although making the dialogue more complex:
(1) Provide a toggle option for Date Phrase Warnings similar to the Date Warnings on the Extra Filters tab.
(2) If Confirm every item found is NOT ticked, then automatically inhibit the Date Phrase Warnings.

The Date Phrase Warning text also needs rewording in the case when ...interpreted as is chosen.
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry

User avatar
Jane
Site Admin
Posts: 8442
Joined: 01 Nov 2002 15:00
Family Historian: V7
Location: Somerset, England
Contact:

Re: Search and Replace (date replacement)

Post by Jane » 07 Jun 2014 11:07

The first solution sounds fine, and it would save having to use complex patterns.
Jane
My Family History : My Photography "Knowledge is knowing that a tomato is a fruit. Wisdom is not putting it in a fruit salad."

User avatar
tatewise
Megastar
Posts: 27087
Joined: 25 May 2010 11:00
Family Historian: V7
Location: Torbay, Devon, UK
Contact:

Re: Search and Replace (date replacement)

Post by tatewise » 09 Jun 2014 11:10

An updated V2.2 of the Search and Replace Plugin is in the Plugin Store with the above improvements.
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry

Post Reply