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
Updated on 19-Dec-2019 09:03:45

Advertisements