[Zope-CMF] some issues from the CMF Collector
seb bacon
seb@jamkit.com
Thu, 16 Jan 2003 10:31:53 +0000
> <http://collector.zope.org/CMF/41>: CMFDefault.utils.bodyfinder
> ---------------------------------------------------------------
...
> PROPOSED SOLUTION (1):
> Make the regex even more complex:
> _bodyre = re.compile( r'^(\s|(<[^<>]*?>))*<html.*<body.*?>',
> re.DOTALL | re.I )
>
> PROPOSED SOLUTION (2):
> 'bodyfinder' is only useful for html documents, it should only be used
> if we made sure we have a html document.
>
> QUESTIONS:
> Solution (1) is just a one line change, (2) seems to be cleaner but
> needs much more changes. Other ideas? Is there a way to make the regex
> in (1) less complex? Which solution should be implemented?
For solution (2) you'd usually end up by having to do some kind of regex
anyway.
(1) seems fine to me, though I guess the "<html.*" bit is now redundant.
seb