Forums

Regarding regular expressions

Can we use the python regular expression library in the web application?

Whenever I try to use the re library in the web application, I get an error. The trace back reads the following

File "/home/srinivas/web2py/gluon/restricted.py", line 205, in restricted exec ccode in environment ...

Is there more to the traceback?

It looks like web2py is having some trouble with your code, but I can't tell what the trouble is from the information you've provided.

EDIT: Hm, perhaps that's a false alarm, it looks like maybe web2py just has a very similar looking exception text.

It looks like something's trying to use the rexec module? If so then I'm quite surprised, as it's been a more or less pointless module since new-style classes were introduced, and since 2.6 Python generates a RuntimeError if you try to instantiate rexec.RExec().

I think you're right about the exception text. That exception is an exception that Web2Py raises after trying to exec some code.

I am extremely sorry! you are correct. It's not related to regular expressions. There is an error in some other part of the code. Thank you for your help!

@srinivas: Welcome to Python Anywhere...WE ARE GLAD to have you join us!!

@all: Never do card tricks for the group you play poker with.