A .
in regex is a metacharacter, it is used to match any character. To match a literal dot in a raw Python string (r""
or r''
), you need to escape it, so r"\."
More Related Contents:
- How to use a variable inside a regular expression?
- Match a whole word in a string using dynamic regex
- Checking whole string with a regex
- Does “\d” in regex mean a digit?
- Create Pandas DataFrame from txt file with specific pattern
- How can I find all matches to a regular expression in Python?
- Easiest way to replace a string using a dictionary of replacements?
- Recursive pattern in regex
- Find longest repetitive sequence in a string
- Python Regex instantly replace groups
- How to remove parentheses and all data within using Pandas/Python?
- Regular Expressions: Search in list
- Return string with first match for a regex, handling case where there is no match
- What’s the cleanest way to extract URLs from a string using Python?
- Regular expression: match start or whitespace
- Check if string matches pattern
- Python – Using regex to find multiple matches and print them out [duplicate]
- Regular expression parsing a binary file?
- Remove duplicate chars using regex?
- Match any unicode letter?
- Python replace string pattern with output of function
- How can I make multiple replacements in a string using a dictionary?
- Python regex split without empty string
- Creating a custom categorized corpus in NLTK and Python
- Warning raised by inserting 4-byte unicode to mysql
- Python: Replace with regex
- Remove non-ASCII characters from a string using python / django
- How to strip whitespace from before but not after punctuation in python
- re.split() gives empty elements in list
- Issue with regex backreference in Python