[FRPythoneers] Porting 1.5.2 regex to 2.2.x re

efm at tummy.com efm at tummy.com
Fri Jun 6 16:24:19 MDT 2003


* 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/



More information about the FRPythoneers mailing list