Quote:
Originally Posted by DiapDealer
Regex ain't magic.
|

Quote:
Originally Posted by JSWolf
How about regex that will take...
<i>"some, stuff? with, punctuation"</i>
and convert it to...
"<i>some, stuff</i>? <i>with</i>, <i>punctuation</i>"
|
Then you run those 2 I listed to take care of the easy cases.
Then you can use the fantastic functionality added in recent Sigil versions to get "Italic Lists", which can list everything between two:
From there, you can do whatever extra tweaks are needed.
For more info on that, see my fantastic descriptions of the workflow back in:
- 2023: "Semantic markup question!"
- Follow the "Do I Put Spaces Inside Italics/Emphasis?" + "Does Punctuation Go Inside the <i> or <em>?" + especially the "What's This Text? <i> or <em>?", where I linked to my:
That allows you to quickly list all HTML that matches your regex into a simple to understand/search/sort list.
I described how that can be used to quickly map all:
- italics <-> emphasis
- acronyms/ALL CAPS <-> smallcaps
- editing/marking dialogue tags
or many other helpful "mass editing" workflows.
The second you sort into a list, the huge ones with lots of punctuation will instantly stand out like a sore thumb:
Code:
<i>Enciclopedia Italiana</i>
<i>New York Times</i>
<i>This sentence is very long? And has lots, and lots, and lots of punctuation inside?</i>
<i>Wall Street Journal</i>
<i>Washington Post</i>
<i>individual</i>
<i>laissez-faire</i>
<i>negative</i>