importing re in Jython

Alan Kennedy alanmk at
Wed Jul 9 14:11:44 CEST 2003

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:
email alan:    

More information about the Python-list mailing list