By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,898 Members | 1,183 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,898 IT Pros & Developers. It's quick & easy.

re module help

P: n/a
I am trying to make prescript-2.2 (old python based psotscript to plain
text converter).
It gives the following dprecation message

/local/users/ishwar/prescript-2.2/misc.py:23: DeprecationWarning: the
regex module is deprecated; please use the re module
import os, regex, sys, string

if I start replacing regex by re I get stuck at replacement of
regex.symcomp() and regex.pattern()

methods. The are not in re module.

Is there a solution?
-ishwar

Sep 9 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
ra****@cps.cmich.edu wrote:
if I start replacing regex by re I get stuck at replacement of
regex.symcomp() and regex.pattern()


Groups identified by names are part of the standard regular expression
syntax:
regex.symcomp ('\(<id>[a-z][a-z0-9]*\)')
becomes
re.compile ('(?Pid[a-z][a-z0-9]*)')

I get AttributeError for both regex.pattern and regex.compile
('abc').pattern.

re compiled regular expression have a pattern attribute, this was named
givenpat and realpat in the regex module.

Daniel
Sep 9 '05 #2

P: n/a
ra****@cps.cmich.edu wrote:
I am trying to make prescript-2.2 (old python based psotscript to plain
text converter).
It gives the following dprecation message

/local/users/ishwar/prescript-2.2/misc.py:23: DeprecationWarning: the
regex module is deprecated; please use the re module
import os, regex, sys, string

if I start replacing regex by re I get stuck at replacement of
regex.symcomp() and regex.pattern()

methods. The are not in re module.

Is there a solution?
-ishwar


This may or may not help:

http://web.archive.org/web/200011190...gex-to-re.html

regards
Steve
--
Steve Holden +44 150 684 7255 +1 800 494 3119
Holden Web LLC http://www.holdenweb.com/

Sep 11 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.