Matching horizontal white space

John Machin sjmachin at lexicon.net
Fri Sep 12 22:01:01 CEST 2008


On Sep 13, 12:52 am, Fredrik Lundh <fred... at pythonware.com> wrote:
> Magnus.Morab... at gmail.com 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*orizontal whitespace, I guess ... looks like the maintainer
of the re equivalent in some other language has far too much spare
time :-)






More information about the Python-list mailing list