View Single Post
Old 02-25-2024, 12:13 PM   #4
reinsley
Connoisseur
reinsley began at the beginning.
 
reinsley's Avatar
 
Posts: 65
Karma: 10
Join Date: Dec 2016
Location: France
Device: Kindle PaperWhite
Hello pdurrant and lomkiri,


Thank you for your help.

I appreciate your good tutorial with negative lookbehind that works fine to find space«space : (?<!">\s—\s«\s.+?)(\.\s«\s), great help as it's a bit difficult to enter the site.

In my sentences I have two space«space : One at the begining of the sentence, one later at any place. It's the dialogue of a same caracter in two sentences. « Blahblah said the man. « Blahblah again.

The first occurence has two html marks before <p class="calibre8"> <span class="calibre3"> space«space to change in <p class="calibre8"> <span class="calibre3"> — space«space
The second space«space has no html mark, just a dotspace«space

Its an opening dialogue dash for one character. I want to had an em dash ( &#x2014 ) to the first occurence <p class="calibre8"> <span class="calibre3"> space«space. I have got it with regex in a first pass. No problem.


A typical dialogue sentence after the first regex pass is <p class="calibre8"> <span class="calibre3"> — « There is a long sentence ending with a comma », said the man.space«spaceThen a second part of the blahblah dotspace»</span> </p>
This is the second . « (dotspace«space) I don't want to grab by regex if a dash is before at the beginning.

How to find : IF <p class="calibre8"> <span class="calibre3"> NO EM DASH at the beginning of the sentence with a long lenght variable text, said the man AND dot NO EM DASH space«space ie (dotspace«space) Second part of the blahblah.dotspace»spec</span> </p>

Then I will insert a CR (Carriage Return).

I stubbornly tried to find the solution with your tutorial but I'm stuck, a kind of lark's mirror. Sorry for my delayed answer.

The bold and increased size are for easy reading, no bad mood on my side.

Best regards.
reinsley is offline   Reply With Quote