Quote:
Originally Posted by Thasaidon
Hi
I have been using Search and Replace and the Saved Searches and switching between them in the Calibre Editor a lot recently.
I have noticed that when I appear to have have the sane regex in both and use the count facility on Search and Replace and the Saved Searches I sometimes get different counts.
I investigated the issue and found this
1. Highlight text <br class="calibre8"/>
2. Paste into Saved Searches Editor
3. Click on Count button
4. Get a count of X
5.Highlight text <br class="calibre8"/>
6.Click on Magnifying Glass Button
7. It puts the text
8. Use the Count Menu Option
9. Get a count of Y
|
As a quick test, I copied the same thing to from the text area into both the search and saved search and the counts came back the same.
Quote:
I think I have spotted why this happens. When the Magnifying Glass Button is used to populate Search and Replace it escapes the outer chevrons i.e. \*<br class="calibre8"/>.
When text is pasted into Saved Searches it does not automatically escape the outer chevrons i.e. <br class="calibre8"/>.
|
These are two different actions. Clicking the magnifying glass button is saying "copy the selected text to the search and escape it appropriately for the current search mode". Whereas cut-and-paste doesn't do this, but it works the same for either type of search. To me, you aren't comparing the same thing in your search.
For your other suggestion, I don't like it. I swap between the search-and-replace and saved searches all the time. And have the edit opened whiles searching enough to not want that. When I am editing a saved search, I frequently run another search looking for why the saved search didn't do what I wanted. Or looking to make sure it did cover all cases.
What would be good would be a way to create a saved search from the current search. That would save some copy-paste actions. Or to copy a saved search to the current search. I frequently edit saved searches and tweak them a bit for the current book but don't want to save the changes. And I have a couple of saved searches that are more templates than actual searches. I expect to change these each time I use them.