04-17-2012, 11:11 AM | #61 | |
Grand Sorcerer
Posts: 28,040
Karma: 199464182
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
Quote:
Code:
<a href="#_edn(\d+)" name="_ednref(\d+)" title=""><span class="MsoEndnoteReference"><span class="MsoEndnoteReference"><b><span style="font-size:8.0pt;font-family:"Times New Roman","serif";color:black">\[(\d+)\]</span></b></span></span></a> Code:
<a href="#_edn\1" id="_ednref\2" title=""><sup>[\3]</sup></a> Find: Code:
<a href="#_edn(\d+)" name="_ednref\d+" title=""><span class="MsoEndnoteReference"><span class="MsoEndnoteReference"><b><span style="font-size:8.0pt;font-family:"Times New Roman","serif";color:black">\[\d+\]</span></b></span></span></a> Code:
<a href="#_edn\1" id="_ednref\1" title=""><sup>[\1]</sup></a> EDIT: The above stuff is all based on the assumption that the <b>, <span>, and font-family/size stuff is identical in all of the original endnote code instances. You'd need to make judicious use of (.*?) if not. (and I had a mistake in the first edition of this post that I corrected) Last edited by DiapDealer; 04-17-2012 at 11:36 AM. |
|
04-17-2012, 11:43 AM | #62 |
Wanderer
Posts: 106
Karma: 472218
Join Date: Jan 2011
Device: Kindle 3, PaperWhite 2
|
Thank you sir!!
Changing name= to id= is one of the first S&R I do on a document. You would think that Word would have changed over by now. Last edited by mncowboy; 04-17-2012 at 11:48 AM. |
Advert | |
|
04-20-2012, 09:09 AM | #63 |
Comparer of the Ephemeris
Posts: 1,496
Karma: 424697
Join Date: Mar 2009
Device: iPad
|
Specifying space character in replace field?
With the old regex engine, I could use '\x20' to specify a space in the replacement pattern, but that no longer works in the current version.
Other than using a literal space, how do I specify a space character in the replace field? (I don't want to use a literal space, because I often save my s/r patterns in a development notes file, and they're hard to see in plain text.) |
04-20-2012, 01:37 PM | #64 |
Guru
Posts: 657
Karma: 64171
Join Date: Sep 2010
Location: Kent, England, Sol 3, ZZ9 plural Z Alpha
Device: Sony PRS-300, Kobo Aura HD, iPad (Marvin)
|
You could use
Code:
& #32; Edit: I think you might only be able use that if the replace is part of text - not inside a tag. Last edited by Perkin; 04-20-2012 at 01:48 PM. |
04-20-2012, 01:53 PM | #65 | |
Comparer of the Ephemeris
Posts: 1,496
Karma: 424697
Join Date: Mar 2009
Device: iPad
|
Quote:
After lots of experimenting, I discovered that I could use Code:
\U \E G |
|
Advert | |
|
05-11-2012, 12:40 PM | #66 |
Wizard
Posts: 2,608
Karma: 3000161
Join Date: Jan 2009
Device: Kindle PW3 (wifi)
|
Hi
It's just a small question. To select letters intended to become dropcaps, I use this part of a Regex: ([A-Z]) However, I realize this does not select accented capitals that do exist in French (like É, À, Ô and so on). Of course, I can just suppress their accents. But if I wish to make a drop-cap out of an accented capital, what would be the code? ([.]) is a catch-all. Have you better? |
05-11-2012, 02:02 PM | #67 | |
Well trained by Cats
Posts: 30,451
Karma: 58055868
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
Quote:
the dash just means range. the normal is any one of these. You can use both as I have |
|
05-11-2012, 03:51 PM | #68 | |
Grand Sorcerer
Posts: 28,040
Karma: 199464182
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
Quote:
Code:
\p{Lu} Last edited by DiapDealer; 05-11-2012 at 04:11 PM. |
|
05-12-2012, 12:10 PM | #69 |
Wizard
Posts: 2,608
Karma: 3000161
Join Date: Jan 2009
Device: Kindle PW3 (wifi)
|
@DiapDealer, theducks
Thanks very much for your replies. As this regex is intended to be used for French texts, I will use theducks' proposal. I just did not know one could add letters this way as I did not see any example of it. |
05-12-2012, 12:47 PM | #70 |
Grand Sorcerer
Posts: 28,040
Karma: 199464182
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
Just so you know, it doesn't matter what language it is. If it's a valid uppercase letter (including unicode characters with acute, grave, breve umlauts—any valid diacritic, really), (\p{Lu}) will capture it. But whatever you're comfortable with is the way to go.
Last edited by DiapDealer; 05-12-2012 at 12:51 PM. |
05-25-2012, 11:41 AM | #71 |
Wizard
Posts: 2,608
Karma: 3000161
Join Date: Jan 2009
Device: Kindle PW3 (wifi)
|
@DiapDealer
Did not see you reply in time. It really needed your explanation. Yes of course, this is also a very convenient solution. I note it. Thanks again. |
06-05-2012, 02:44 PM | #72 | ||
Addict
Posts: 385
Karma: 3102
Join Date: Dec 2010
Location: EU
Device: Kobo Aura ONE, Kobo Libra H20
|
Change Chapter text to Heading
How can I change in Sigil all the occurrences of "Chapter" like the following example:
Quote:
...or even "1", "2", "3",... with Quote:
Edit: Never mind I think I found the solution in JeremyR's post. Many thanks, JeremyR Last edited by paulfiera; 06-05-2012 at 03:01 PM. Reason: Found solution. |
||
06-05-2012, 02:59 PM | #73 |
Sigil developer
Posts: 1,274
Karma: 1101600
Join Date: Jan 2011
Location: UK
Device: Kindle PW, K4 NT, K3, Kobo Touch
|
You don't say what the original Chapter One looks like in code view. Just the text isn't sufficient to make sure the find/replace is correct.
Assuming you have Code:
<p>Chapter SOMETHING</p> Code:
<h1>Chapter SOMETHING</h1> Code:
Find: (?sU)<p>Chapter (.*)</p> Replace: <h1>Chapter \1</h1> |
06-05-2012, 03:09 PM | #74 | |||
Addict
Posts: 385
Karma: 3102
Join Date: Dec 2010
Location: EU
Device: Kobo Aura ONE, Kobo Libra H20
|
Quote:
In Code View it is Quote:
Quote:
Don't know if I'm doing this right though I have more books with the same issue. I'll try with your code next time. Many thanks. |
|||
06-19-2012, 09:00 AM | #75 |
Wizard
Posts: 2,608
Karma: 3000161
Join Date: Jan 2009
Device: Kindle PW3 (wifi)
|
Successive Find and Replace
I wish to clean an html text which suffers from recurrent mistakes from an OCR engine (Cuneiform). When I meet one the mistakes, I make a replacement and I note it. After some pages, I met most of the mistakes and now I intend to build a regex, adding as many as 15 successive simple search and replace like the following two. A@ → à B@ → ç I do not know how to perform these 15 F&R within a simple regex.Suppose I would like to build it for the two above, what should I write? Nota: I already use utf8 for the whole text. |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Examples of Subgroups | emonti8384 | Lounge | 32 | 02-26-2011 07:00 PM |
Accessories Pen examples | Gunnerp245 | enTourage Archive | 15 | 02-21-2011 04:23 PM |
Stylesheet examples? | Skitzman69 | Sigil | 15 | 09-24-2010 09:24 PM |
Examples | kafkaesque1978 | iRiver Story | 1 | 07-26-2010 04:49 PM |
Looking for examples of typos in eBooks | Tonycole | General Discussions | 1 | 05-05-2010 05:23 AM |