- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- MS Excel
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP
- Physics
- Chemistry
- Biology
- Mathematics
- English
- Economics
- Psychology
- Social Studies
- Fashion Studies
- Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
How to split on successions of newline characters using Python regular expression?
The following code splits on successions of newline characters in the following string using Python regex
Example
import re s = """I find Tutorialspoint useful""" print re.split(r"[\n]", s)
Output
This gives the output
['I find', ' Tutorialspoint', ' useful']
Advertisements