View Single Post
Old 03-24-2021, 10:58 PM   #6
BKh
Zealot
BKh can extract oil from cheeseBKh can extract oil from cheeseBKh can extract oil from cheeseBKh can extract oil from cheeseBKh can extract oil from cheeseBKh can extract oil from cheeseBKh can extract oil from cheeseBKh can extract oil from cheese
 
BKh's Avatar
 
Posts: 107
Karma: 1000
Join Date: Mar 2011
Device: Kindle
Quote:
Originally Posted by Tex2002ans View Post
What is the problem you're trying to solve? Can you give some before/after code examples?

Usually when you reach beyond 9 capture groups in a single regex... there's some sort of underlying issue that can be solved more efficiently.
Absolutely! And if my multiple attempts to learn Python had ever succeeded I wouldn't be in this situation.

I have an interlinear text with verses where the six lines of text are interspersed, and each line has an index number.

<p>
index1 originalline1 tranlsationline1
index2 originalline2 tranlsationline2
index3 originalline3 tranlsationline3
index4 originalline4 tranlsationline4
index5 originalline5 tranlsationline5
index6 originalline6 tranlsationline6</p>

And what I need is

<p>
index1 originalline1
index2 originalline2
index3 originalline3
index4 originalline4
index5 originalline5
index6 originalline6

index1 tranlsationline1
index2 tranlsationline2
index3 tranlsationline3
index4 tranlsationline4
index5 tranlsationline5
index6 tranlsationline6</p>

But labeling the segments works just fine.

Thanks everyone for all the help!!!
BKh is offline   Reply With Quote