Re: [Tutor] Python re without string consumption

2007-01-25 Thread Terry Carroll
On Thu, 25 Jan 2007, Jacob Abraham wrote: >I would like to thank you for the solution and > the helper funtion that I have written is as follows. That's very similar to a solution I coded up for a friend, who was doing searches in genetic sequences, and had exactly the same problem you did

Re: [Tutor] Python re without string consumption

2007-01-25 Thread Kent Johnson
Jacob Abraham wrote: > Hi Danny Yoo, > >I would like to thank you for the solution and > the helper funtion that I have written is as follows. But I do hope > that future versions of Python include a regular expression syntax to > handle such cases simply because this method seems very process

Re: [Tutor] Python re without string consumption

2007-01-25 Thread Jacob Abraham
Hi Danny Yoo, I would like to thank you for the solution and the helper funtion that I have written is as follows. But I do hope that future versions of Python include a regular expression syntax to handle such cases simply because this method seems very process and memory intensive. I also not

Re: [Tutor] Python re without string consumption

2007-01-24 Thread Luke Paireepinart
> > def searchall(expr, text, fall_back_len=0): > [snip] > > text = text[end-fallbacklen:] oops, those look like two different variables to me. ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Python re without string consumption

2007-01-24 Thread Jacob Abraham
searchall("abca", "abcabcabca", 1): print match.group() Thanks Again. Jacob Abraham - Original Message From: Danny Yoo <[EMAIL PROTECTED]> To: Jacob Abraham <[EMAIL PROTECTED]> Cc: python Sent: Thursday, January 25, 2007 12:14:31 PM Subject: Re:

Re: [Tutor] Python re without string consumption

2007-01-24 Thread Danny Yoo
On Wed, 24 Jan 2007, Jacob Abraham wrote: import re re.findall("abca", "abcabcabca") > ["abca", "abca"] > > While I am expecting. > > ["abca", "abca", "abca"] Hi Jacob, Just to make sure: do you understand, though, why findall() won't give you the results you want? The documentati

[Tutor] Python re without string consumption

2007-01-24 Thread Jacob Abraham
Dear Tutors, I'm having a little trouble while using the re module. eg >>> import re >>> re.findall("abca", "abcabcabca") ["abca", "abca"] While I am expecting. ["abca", "abca", "abca"] How do I modify my regular expression to do the same. Thanks for the help. Regards, Jacob Abraham