>>> re.split('(\W)', 'foo/bar spam\neggs')
['foo', "https://stackoverflow.com/", 'bar', ' ', 'spam', '\n', 'eggs']
More Related Contents:
- Searching for IP addresses in a file
- How to understand regular expression with python?
- Escaping regex string
- Split string on whitespace in Python [duplicate]
- Python non-greedy regexes
- Python and regular expression with Unicode
- Match text between two strings with regular expression
- Regex to extract URLs from href attribute in HTML with Python [duplicate]
- How to replace only part of the match with python re.sub
- How to split by commas that are not within parentheses?
- BeautifulSoup webscraping find_all( ): finding exact match
- In Python, how to check if a string only contains certain characters?
- Regex: AttributeError: ‘NoneType’ object has no attribute ‘groups’
- remove unicode emoji using re in python
- Python – RegEx for splitting text into sentences (sentence-tokenizing) [duplicate]
- Re.match() returns always none
- How to use regular expression in lxml xpath?
- replacing only single instances of a character with python regexp
- Why isn’t the regular expression’s “non-capturing” group working?
- Python Regular Expression Match All 5 Digit Numbers but None Larger
- Python regular expression for HTML parsing
- Remove Sub String by using Python
- Type of compiled regex object in python
- How does python and the regex module handle backslashes?
- How to tell if one regular expression matches a subset of another regular expression?
- How do I verify that a string only contains letters, numbers, underscores and dashes? [duplicate]
- Python regex: matching a parenthesis within parenthesis
- Regexp finding longest common prefix of two strings
- Splitting a math expression string into tokens in Python
- Download all pdf files from a website using Python