[Tutor] search/match file position q

Clayton Kirkwood crk at godblessthe.us
Tue Oct 7 21:40:54 CEST 2014


!>
!> So, what makes regex wrong for this job?
!
!A regex doesn't understand the structure of an html document. For
!example
!you need to keep track of the nesting level manually to find the cells
!of
!the inner of two nested tables.
!
!> question still remains: does the
!> search start at the beginning of the line each time or does it step
!> forward from the last search?
!
!re.search() doesn't keep track of prior searches; whatever string you
!feed
!it (in your case a line cut out of an html document) is searched.
!

So, you are saying that each regex starts at the beginning of the long line?
Is there a way to start the next search at the end of the last one?

!> I will check out beautiful soup as suggested
!> in a subsequent mail; I'd still like to finish this process:<}}
!
!Do you say that when someone points out that you are eating your shoe?

Depends on the flavor of the shoe:<)))

Clayton




More information about the Tutor mailing list