No. Regular expressions in Python are handled by the re
module.
article = re.sub(r'(?is)</html>.+', '</html>', article)
In general:
text_after = re.sub(regex_search_term, regex_replacement, text_before)
More Related Contents:
- How to use a variable inside a regular expression?
- Match a whole word in a string using dynamic regex
- How to check for valid email address? [duplicate]
- Case insensitive regular expression without re.compile?
- Python string.replace regular expression [duplicate]
- Split a string at uppercase letters
- Regex matching 5-digit substrings not enclosed with digits
- How to split but ignore separators in quoted strings, in python?
- Python regex match OR operator
- Regular expression to extract URL from an HTML link
- Python Regex escape operator \ in substitutions & raw strings
- How to extract an IP address from an HTML string?
- Regex for existence of some words whose order doesn’t matter
- Split string based on a regular expression
- Split string on commas but ignore commas within double-quotes?
- Python/Regex – How to extract date from filename using regular expression?
- How would I get everything before a : in a string Python
- Python regex: splitting on pattern match that is an empty string
- 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
- How do I verify that a string only contains letters, numbers, underscores and dashes? [duplicate]
- Python regex findall
- 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