hi.
thanks for the reply.
tried what you suggested. what I see now, is that I print out the
lines, but not the regex data at all. my initial try, gave me the
line, and then the next items , followed by the next line, etc...
what I then tried, was to do a capture/findall of the regex, and
combine the outputs in separate loops, which will be ugly but will
work....
ff= "byu2.dat"
#fff= "sdsu2.dat"
with open(ff,"r") as myfile:
s=myfile.read()
s=s.replace(" ", "")
#with open(fff,"w") as myfile2:
# myfile2.write(s)
#<br>#45 / 58#0#
#<br>#45 / 58#0#
#dat1=re.compile("<br>#(\d+) / (\d+)#(\d+)#").search(s).findall()
dat1=re.findall("<br>#(\d+) / (\d+)#(\d+)#",s)
dat=re.compile("<br>#(\d+) / (\d+)#(\d+)#").split(s)
dat2 = re.compile(r"<br>#\d+ / \d+#\d+#").split(s)
#dat=re.split('("<br>#(\d+) / (\d+)#(\d+)#")',s)
#dat=re.compile("<br>#(\d+)").split(s)
for m in dat:
if m:
print "m = "+m
#sys.exit()
print "dat1"
print dat1
print len(dat1)
print "dat2a"
#sys.exit()
# for m in dat1:
# if m:
# print "m = "+m
#
# #sys.exit()
for m in dat2:
if m:
print "m = "+m
#sys.exit()
sys.exit()
return
the test data is pasted to -->>>
http://bpaste.net/show/kYzBUIfhc5023phOVmcu/
thanks
!!
> --
>
https://mail.python.org/mailman/listinfo/python-list