Match Tab and Newline Using Python Regular Expression



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']
Updated on: 2019-12-19T09:03:45+05:30

2K+ Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements