View Single Post
Old 09-07-2023, 07:54 PM   #11
Tex2002ans
Wizard
Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.
 
Posts: 2,306
Karma: 13057279
Join Date: Jul 2012
Device: Kobo Forma, Nook
Quote:
Originally Posted by DiapDealer View Post
Regex ain't magic.


Quote:
Originally Posted by JSWolf View Post
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:
  • <i></i>

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>

Last edited by Tex2002ans; 09-07-2023 at 08:10 PM.
Tex2002ans is offline   Reply With Quote