I need a regex in Python2 to match only horizontal white spaces not newlines.
\\s matches all whitespaces including newlines.
>&
I ended up using [^\S\n] instead of specifying all Unicode white spaces.
>>> re.sub(r"[^\S\n]", "", u"line 1.\nline 2\n\u00A0\u200A\n", flags=re.UNICODE)
u'line1.\nline2\n\n'
>>> re.sub(r"[\t ]", "", u"line 1.\nline 2\n\u00A0\u200A\n", flags=re.UNICODE)
u'line1.\nline2\n\xa0\u200a\n'
It works as expected.