[0-9]
is not always equivalent to \d
. In python3, [0-9]
matches only 0123456789
characters, while \d
matches [0-9]
and other digit characters, for example Eastern Arabic numerals ٠١٢٣٤٥٦٧٨٩
.
More Related Contents:
- How to handle response encoding from urllib.request.urlopen() , to avoid TypeError: can’t use a string pattern on a bytes-like object
- Take first some character of string but if particular character will come consider that character also
- How to extract numbers from a string in Python?
- How to determine the encoding of text?
- Is it worth using Python’s re.compile?
- Extract float/double value
- Python regex – r prefix
- regex for Twitter username
- Matching Nested Structures With Regular Expressions in Python
- Python re.sub back reference not back referencing [duplicate]
- How to grab number after word in python
- How to print UTF-8 encoded text to the console in Python < 3?
- Extract a string between double quotes
- Reuse part of a Regex pattern
- UnicodeEncodeError: ‘ascii’ codec can’t encode character at special name [duplicate]
- Find the indexes of all regex matches?
- Scikit-learn’s LabelBinarizer vs. OneHotEncoder
- SyntaxError of Non-ASCII character [duplicate]
- Python – re.findall returns unwanted result
- Why Does a Repeated Capture Group Return these Strings?
- Splitting out the output of ps using Python
- How to use regex to find all overlapping matches
- Split string at every position where an upper-case word starts
- FutureWarning: The default value of regex will change from True to False in a future version
- Regex matching – why does this not match and return None?
- How to use python regex to replace using captured group? [duplicate]
- applying regex to a pandas dataframe
- python regex first/shortest match
- What is the Python way of doing a \G anchored parsing loop?
- module ‘re’ has no attribute ‘findall’ [duplicate]