On Mar 19, 10:33 pm, [EMAIL PROTECTED] wrote:
> hi
> how can i use regexp to group these digits into groups of 3?
>
> eg
> line 123456789123456789
>
> i have :
>
> pat = re.compile("line\s+(\d{3})" , re.M|re.DOTALL)
>
> but this only gives the first 3. I also tried
>
> "line\s+(\d{3})+"
> but also
On Mar 20, 1:57 pm, Shane Geiger <[EMAIL PROTECTED]> wrote:
> import re
> line = '123456789123456789'
> print re.findall('([0-9]{3})', line)
>
>
>
> Shane Geiger wrote:
> > You don't even need regex.
>
> > def
> > split_seq(seq,size):
>
> ># this is sort of the inverse of
> > flatten
>
> >#
import re
line = '123456789123456789'
print re.findall('([0-9]{3})', line)
Shane Geiger wrote:
You don't even need regex.
def
split_seq(seq,size):
# this is sort of the inverse
You don't even need regex.
def
split_seq(seq,size):
# this is sort of the inverse of
flatten