Re: [Zope] Regular Expressions

2006-04-20 Thread Tino Wildenhain
April Lekin wrote:
> Can you use regular expressions in Zope?
> 
> I'm trying to do a date match, something like this:
> 
> date = re.match(l_date, '\d\d\d\d\/\d\d/\d\d')
> 
> Looks like it doesn't like the "re.match"?

Well, if you look into the zope API documentation
you find all modules you can use in untrusted
(e.g. thru the web) code. re isnt part of the
exposed API. You either write an external method
or a product or you enable modules you think you
can trust to zope scripting. This can be done
by copying Products/PythonScripts/module_access_example.py (or similar)
to yourProductfolder/Yourproduct/__init__.py
and edit it accordingly. Restart zope
and use the modules you want. Make sure you enable
only modules you really can trust.

Regards
Tino Wildenhain
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Regular Expressions

2006-04-20 Thread Dennis Allison

Regular expressions are usually precluded as a potential security risk.  
You can enable imports into Python Scripts (see instructions in the 
source) fairly easily.  Or you can do the regular expression processing
you need in an External Method or Product.

And, of course, you'll need to "import re" in the module where you 
use it.


On Thu, 20 Apr 2006, April Lekin wrote:

> Can you use regular expressions in Zope?
> 
> I'm trying to do a date match, something like this:
> 
> date = re.match(l_date, '\d\d\d\d\/\d\d/\d\d')
> 
> Looks like it doesn't like the "re.match"?
> 
> ___
> Zope maillist  -  Zope@zope.org
> http://mail.zope.org/mailman/listinfo/zope
> **   No cross posts or HTML encoding!  **
> (Related lists - 
>  http://mail.zope.org/mailman/listinfo/zope-announce
>  http://mail.zope.org/mailman/listinfo/zope-dev )
> 

-- 

___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


[Zope] Regular Expressions

2006-04-20 Thread April Lekin

Can you use regular expressions in Zope?

I'm trying to do a date match, something like this:

date = re.match(l_date, '\d\d\d\d\/\d\d/\d\d')

Looks like it doesn't like the "re.match"?

___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope-dev )