
- Python Basic Tutorial
- Python - Home
- Python - Overview
- Python - Environment Setup
- Python - Basic Syntax
- Python - Comments
- Python - Variables
- Python - Data Types
- Python - Operators
- Python - Decision Making
- Python - Loops
- Python - Numbers
- Python - Strings
- Python - Lists
- Python - Tuples
- Python - Dictionary
- Python - Date & Time
- Python - Functions
- Python - Modules
- Python - Files I/O
- Python - Exceptions
How to match tab and newline but not space 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']
- Related Articles
- How to match anything except space and new line using Python regular expression?
- How to match whitespace but not newlines using Python regular expressions?
- How to split on successions of newline characters using Python regular expression?
- How to match a word in python using Regular Expression?
- How to match a whitespace in python using Regular Expression?
- How to match only digits in Python using Regular Expression?
- How to match a nonwhitespace character in python using Regular Expression?
- How to match a single character in python using Regular Expression?
- How to match parentheses in Python regular expression?
- Remove newline, space and tab characters from a string in Java
- How to match any one lowercase vowel in python using Regular Expression?
- How to match digits using Java Regular Expression (RegEx)
- PHP – Match regular expression using mb_ereg_match()
- How to match at the beginning of string in python using Regular Expression?
- How to match non-digits using Java Regular Expression (RegEx)

Advertisements