[FRPythoneers] Porting 1.5.2 regex to 2.2.x re

Erick Bodine erick at allocity.com
Fri Jun 6 16:40:46 MDT 2003


Here is the format of a footer that would get passed in

FtrFormat = """
------------------------------------------------------------------------
--------
-@||-                  @|||||||||||||||||||||||||||||||
-@||-
self.page+1,           date,
self.page+1
------------------------------------------------------------------------
--------
"""

It would then look like so, if properly parsed.

------------------------------------------------------------------------
--------

- 4 -                      Fri Jun 06 16:38:45 2003
- 4 -

------------------------------------------------------------------------
--------

--ERick


-----Original Message-----
From: efm at tummy.com [mailto:efm at tummy.com] 
Sent: Friday, June 06, 2003 4:24 PM
To: frpythoneers at lists.community.tummy.com
Subject: Re: [FRPythoneers] Porting 1.5.2 regex to 2.2.x re


* On 2003-06-06 22:11 Erick Bodine <erick at allocity.com> wrote:

What does the data look like?

efm

> I am by no means an regular expression expert but I am having trouble 
> porting an older python (1.5.2) script that I did not write to 2.2.x
> 
> This is the 1.5.2 code and the returned list:
> 
> tokens = regsub.splitx(formLine, 
> "[@\^]\([|<>*#]\)\\1*\(\\1\|\.\)?\\1*")
> print tokens
> 
> ['===', '@<<<<<<<<', '====', '@>>>>>>>>>>>', '====', '@||||||||||||', 
> '====', '@ ####.##', '===.', '^<<<<<<<<<<<<<<<<', '']
> 
> This is what I have for 2.2.x
> 
> tokens = re.split("[@\^]\([|<>*#]\)\1*\(\1\|\.\)?\1*", formLine) print

> tokens
> 
> ['===@<<<<<<<<====@>>>>>>>>>>>====@||||||||||||====@####.##===.^<<<<<<
> <<
> <<<<<<<<
> ']
> 
> Obviously I would prefer that the later code return a list of same 
> form that the older code does but I am having an incredible time 
> making it do just that.
> 
> --ERick
> _______________________________________________
> This message sent by the FRPythoneers mailing list.
> Unsubscribe: echo unsubscribe | 
> FRPythoneers-request at lists.community.tummy.com
> URL: http://lists.community.tummy.com/mailman/listinfo/frpythoneers

-- 
Regards,                    tummy.com, ltd 
Evelyn Mitchell             Linux Consulting since 1995
efm at tummy.com               Senior System and Network Administrators
                            http://www.tummy.com/
_______________________________________________
This message sent by the FRPythoneers mailing list.
Unsubscribe: echo unsubscribe |
FRPythoneers-request at lists.community.tummy.com
URL: http://lists.community.tummy.com/mailman/listinfo/frpythoneers



More information about the FRPythoneers mailing list