doublequotes in regexp 1.5.2 - zope/externalmethod

Ulrich Petri ulope at gmx.de
Tue Jul 8 17:57:29 EDT 2003


"Florian Konnertz" <florian.konnertz at web.de> schrieb im Newsbeitrag
news:bed11r$ssr$05$1 at news.t-online.com...
> Hi,
>
> I have to do a little script for an old zope website running on
> python1.5.2 and have a regexp problem.
>
> (for those who know zope: I have to change all stx links in a dtml doc
> to html which is not done for any reason. It's an old zope (2.3.2) :(
> python is 1.5.2  I tried with string.find, but i get a "string object
> has no atribute 'find'" error - find is documented for python-1.5.2 :-/
> So i guesses i have to use an External Method where i can use re.)
>
In python 1.5.2 you have to use:

import string

s="blah pattern blah"
pos = string.find(s, "pattern")


for Zope this would be:
<dtml-var "_.string.find(REQUEST['somevar'], 'somepattern')">

HTH

Ciao Ulrich






More information about the Python-list mailing list