01-19-2011, 03:48 AM | #1 |
Wizard
Posts: 3,720
Karma: 1759970
Join Date: Sep 2010
Device: none
|
find replace - does it auto-fix closing tqags ???
was having a frustrating time with find-replace regex last night
- I swear that some times it just sulks and claims to not find any instances of perfectly good expressions, or waits until you re-click the code view window before searching properly - anyway I gave up building a regex that would alter pairs of opening & closing tags and figured I'd fix them in 2 passes - so I did something like replace all "<h4" with "<h2", intending to then do replace "</h4" with "</h2> as a 2nd pass - but somehow all of the end pairs had miraculously already fixed themselves was I seeing things, was this the tidy function helping out, or what ? if tag pairs can be replaced justt be replacing the opening tag , that would be good to know as the regex building then becomes MUCH simpler! |
01-19-2011, 04:22 AM | #2 |
Wizard
Posts: 3,720
Karma: 1759970
Join Date: Sep 2010
Device: none
|
UPDATE- after more testing - I am pretty sure that closing tags are being auto fixed somehow - tried it in other books -
more find- replace inconsistencies 1. code view window does not update to show effect of find / replace - so it look like command has failed 2. crtl F, or highlight text populates FIND box only if find / replace window was closed. if that window is already open then highlighted text has to be manually copied & pasted, or window has to be closed & text re-highlighted - annoying. |
Advert | |
|
01-19-2011, 06:48 AM | #3 |
♫
Posts: 660
Karma: 506380
Join Date: Aug 2010
Location: Germany
Device: Kobo Aura / PB Lux 2 / Bookeen Frontlight / Kobo Mini / Nook Color
|
I can confirm both, first Sigil has an issue sometimes with doing 2 search/replace after each other, you have to click onto the text first (and lose the actual position where you are in the text to really get the replace done), and second, it autofixes most (I guess all) closing tags.
|
01-19-2011, 07:55 AM | #4 |
Well trained by Cats
Posts: 29,782
Karma: 54830978
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
Tidy is fixing mis-matched tags. Don't count on it to always guess where they should be
I have reported S + R skipping files in a ALL HTML replace, but something Valloric recently wrote may point to a faulty assumption I made. I assumed S+R was done in "reading order", by direction (say, C03 to End, for down). I can't come up with a guaranteed to repeat, case/file I have also watched S+R show the replaces, then forget (undo all?) while still editing. Again, no repeatable case. Usually, the second time, Replace 'takes'. It is annoying. |
01-19-2011, 08:43 AM | #5 |
Wizard
Posts: 3,720
Karma: 1759970
Join Date: Sep 2010
Device: none
|
thanks for the clarifications - the auto replace of matching closing tags is great, but I would have saved hours of tedious regex construction had that been properly documented. I naturally assumed that find replace would do only what it was instructed to do.
one easy? fix I would like to see to F R would be for highlighting text to auto populate the find field, even if find window is already open. and my 2nd wish would be for code view to auto refresh and thus to show the effect of F R |
Advert | |
|
01-19-2011, 10:34 AM | #6 | |
Well trained by Cats
Posts: 29,782
Karma: 54830978
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
Quote:
and Paste into/over the Find or the replace (useful for really long Find- patterns that have tiny changes) |
|
01-19-2011, 02:32 PM | #7 |
Wizard
Posts: 3,720
Karma: 1759970
Join Date: Sep 2010
Device: none
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Find / replace | bremler | Sigil | 6 | 12-17-2010 03:26 PM |
505 died - should I fix or replace it? | BBRags | Sony Reader | 14 | 04-08-2010 02:46 AM |
eNews - How to auto replace old files | bthoven | Calibre | 23 | 09-23-2009 02:34 AM |
ms word : how to fix auto-formatted lists ? | zelda_pinwheel | Workshop | 4 | 07-12-2009 02:19 PM |
Using Find/Replace with BD | Otter | Sony Reader | 7 | 02-28-2009 01:49 PM |