Re: Matching horizontal white space

2008-09-14 Thread Ben Finney
[EMAIL PROTECTED] writes: > multipleSpaces = re.compile(u'\\h+') > > importantTextString = '\n \n \n \t\t ' > importantTextString = multipleSpaces.sub("M", importantTextString) Please get into the habit of following the Python coding style guide http://www.python.org/dev/peps/pep-0008>. For

Re: Matching horizontal white space

2008-09-12 Thread John Machin
On Sep 13, 12:52 am, Fredrik Lundh <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: > > multipleSpaces = re.compile(u'\\h+') > > > importantTextString = '\n  \n  \n \t\t  ' > > importantTextString = multipleSpaces.sub("M", importantTextString) > > what's "\\h" supposed to mean? Match *h*orizo

Re: Matching horizontal white space

2008-09-12 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote: multipleSpaces = re.compile(u'\\h+') importantTextString = '\n \n \n \t\t ' importantTextString = multipleSpaces.sub("M", importantTextString) what's "\\h" supposed to mean? I would have expected consecutive spaces and tabs to be replaced by M but nothing is bein

Matching horizontal white space

2008-09-12 Thread Magnus . Moraberg
multipleSpaces = re.compile(u'\\h+') importantTextString = '\n \n \n \t\t ' importantTextString = multipleSpaces.sub("M", importantTextString) I would have expected consecutive spaces and tabs to be replaced by M but nothing is being replaced. If I try the following, then I'm left only with M,