Hi, I currently have a lines property with a ZOPE path on
each line, and the following statement which works:
"Paths" Lines
Property
-----------------------------
/path/one
/path/two
DTML Code
----------------------------
<!--#if "_['sequence-item'] ==
PATH_INFO "-->
Match - <!--#var
sequence-item--><br>
<!--#else-->
No Match
- <!--#var
sequence-item--><br>
<!--#/if-->
In this case, there is a match if the
current Zope PATH_INFO is equal to "/path/one" or
"/path/two", exact matches only. A path of
"/path/one/folder/" is not a match, because it's not
exact.
What I would like to do a substring search
for a match, instead of a full comparison, something like this:
<!--#if "PATH_INFO (STARTS WITH)
_['sequence-item']"-->
Match - <!--#var
sequence-item--><br>
<!--#else-->
No Match
- <!--#var
sequence-item--><br>
<!--#/if-->
In this example, a PATH_INFO of "/path/one/folder" would be a
match, beause it starts with "/path/one", which is one of the
given values.
I tried playing with the Python search() and match() functions, but
couldnt get them to work.
Can someone tell me how/if this type of matching can be done?
Much appreciated,
KH