Le Thursday 26 June 2008 15:53:06 oyster, vous avez écrit : > that is, there is no TABLE tag between a TABLE, for example > <table >something with out table tag</table> > what is the RE pattern? thanks > > the following is not right > <table.*?>[^table]*?</table>
The construct [abc] does not match a whole word but only one char, so [^table] means "any char which is not t, a, b, l or e". Anyway the inside table word won't match your pattern, as there are '<' and '>' in it, and these chars have to be escaped when used as simple text. So this should work: re.compile(r'<table(|[ ].*)>.*</table>') ^ this is to avoid matching a tag name starting with table (like <table_ext>) -- Cédric Lucantis -- http://mail.python.org/mailman/listinfo/python-list