python regex: variable length of positive lookbehind assertion

Yubin Ruan ablacktshirt at gmail.com
Wed Jun 15 00:38:29 EDT 2016


On Wednesday, June 15, 2016 at 12:18:31 PM UTC+8, Lawrence D’Oliveiro wrote:
> On Wednesday, June 15, 2016 at 3:28:37 PM UTC+12, Yubin Ruan wrote:
> 
> > I want to match the all the text surrounded by those "<a> </a>",
> 
> You are trying to use regex (type 3 grammar) to parse HTML (type 2 grammar) <https://en.wikipedia.org/wiki/Formal_grammar#The_Chomsky_hierarchy>?
> 
> No can do <http://stackoverflow.com/questions/1732348/regex-match-open-tags-except-xhtml-self-contained-tags/1732454#1732454>.


Yes. I think you are correct. Thanks.



More information about the Python-list mailing list