Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   Python (http://www.velocityreviews.com/forums/f43-python.html)
-   -   importing re in Jython (http://www.velocityreviews.com/forums/t319437-importing-re-in-jython.html)

Alexis Francart 07-09-2003 11:18 AM

importing re in Jython
 
Hello,

I want to use a program called maxq. This program is used for functionnal
and regression test of web application. The language it uses is Jython.
I need to get a part of a web page using regular expression.
However i try to import the RE library but i'm not able to.
Since the Jython.jar already contains an ORO i tried to use it but without
success. I then tried to import the RE library but was unable to do so. I
then try to import the regexp library from jakarta but without success.

Do you know how i can import the RE module in Jython?

NB: I hope the part on my life interested you since it has not too much to
do with the question.

Alexis

Alexis Francart 07-09-2003 11:58 AM

Re: importing re in Jython
 
Alexis Francart <alexis.francart@nospam.xagagroup.com> wrote in
news:Xns93B386C32C053alexisfrancartnospam@193.252. 19.141:

> Do you know how i can import the RE module in Jython?


Ok i've managed to import it. I'm new to jython and python so i think this
is basic but unless the command line you have got to enter the whole pass
in the script so ihave to enter

from org.python.modules import re

instead of a simple

import re

thanks for your help

Alan Kennedy 07-09-2003 12:11 PM

Re: importing re in Jython
 
Alexis Francart wrote:

> Do you know how i can import the RE module in Jython?


Works fine for me on Win2K, J2SDK1.4.2 and Jython 2.1:-

Jython 2.1 on java1.4.2 (JIT: null)
Type "copyright", "credits" or "license" for more information.
>>> import re
>>> rx = re.compile('[0-9]+')
>>> for sn in ['1', '10', 's10']:

.... m = rx.match(sn)
.... if m:
.... print "'%s' matches" % sn
....
'1' matches
'10' matches
>>>


Perhaps if you gave us some details, such as

1. Your OS
2. Your JRE version
3. Your jython version
4. What code you're using

Then it might be easier to help out.

--
alan kennedy
-----------------------------------------------------
check http headers here: http://xhaus.com/headers
email alan: http://xhaus.com/mailto/alan


All times are GMT. The time now is 08:58 AM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.