110,000 results
Open links in new tab
  1. re.sub() - Python RegEx - GeeksforGeeks

    Oct 6, 2026 · re.sub () function in Python is used to replace occurrences of a regular expression pattern in a string with a specified …

  2. re — Regular expression operations — Python 3.15.2 documentation

    1 day ago · re.sub(pattern, repl, string, count=0, flags=0) ¶ Return the string obtained by replacing the leftmost non-overlapping …

  3. Python re.sub () - Replace using Regular Expression

    Python re.sub () Function re.sub () function replaces one or many matches with a string in the given text. The search and …

  4. Python RegEx - W3Schools

    A RegEx, or Regular Expression, is a sequence of characters that forms a search pattern.

  5. python - re.sub replace with matched content - Stack Overflow

    I don't, how do I get Python to return the correct result rather than $1? Is re.sub even the right function to do this?

  6. Regular expression HOWTO — Python 3.15.2 documentation

    2 days ago · Regular expression HOWTO ¶ Abstract This document is an introductory tutorial to using regular expressions in Python …

  7. Python re sub () method - Online Tutorials Library

    The Python re.sub() method is used to substitute occurrences of a pattern in a string with another string. It searches for all non …

  8. How to replace only part of the match with python re.sub

    How to replace only part of the match with python re.sub Ask Question Asked 16 years, 6 months ago Modified 1 year, 3 months ago

  9. Python Regex sub () Function

    Summary: in this tutorial, you’ll learn about the Python regex sub () function that returns a string after replacing the matched pattern …

  10. Mastering Python's `re.sub` for Regular Expression Substitution

    Oct 25, 2026 · Conclusion Python's re.sub function is a versatile and powerful tool for text substitution based on regular expression …