How to match tab and newline but not space using Python regular expression?

PythonServer Side ProgrammingProgramming

The following code matches tab and newline but not space from given string using regex.

Example

import re
print re.findall(r"[\n\t]","""I find
    Tutorialspoint useful""")

Output

This gives the output

['\n']
raja
Published on 08-Jan-2018 18:31:26
Advertisements