About 103,000 results
Open links in new tab
  1. re — Regular expression operations — Python 3.14.3 documentation

    2 days ago · To apply a second repetition to an inner repetition, parentheses may be used. For example, the expression (?:a{6})* matches any multiple of six 'a' characters. The special characters are: (Dot.) …

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

    re.sub () function replaces one or many matches with a string in the given text. In this tutorial, we will learn how to use re.sub () function with the help of examples.

  3. re.sub() - Python RegEx - GeeksforGeeks

    Jul 23, 2025 · re.sub () method in Python parts of a string that match a given regular expression pattern with a new substring. This method provides a powerful way to modify strings by replacing specific …

  4. Python Regex sub () Function

    In this tutorial, you'll learn about the Python regex sub () function that returns a string after replacing the matched pattern in a string with a replacement.

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

    For the replacement portion, Python uses \1 the way sed and vi do, $1 the way Perl, Java, and Javascript (amongst others) do. Furthermore, because \1 interpolates in regular strings as the …

  6. Mastering `re.sub()` in Python: A Comprehensive Guide

    Apr 6, 2025 · Whether you're cleaning up data, formatting text, or performing complex search-and-replace operations, understanding re.sub() is essential. This blog post will dive deep into the …

  7. re.subPython Function Reference

    A comprehensive guide to Python functions, with examples. Find out how the re.sub function works in Python. Return the string obtained by replacing the leftmost non-overlapping occurrences of pattern …

  8. Python re.sub: Replace and Modify Text with Regular Expressions

    Nov 8, 2024 · Learn how to use Python's re.sub function for text replacement and modification using regular expressions. Master pattern-based string substitutions with examples.

  9. Python re.sub - Mastering Regular Expression Substitution

    Apr 20, 2025 · The re.sub function is a powerful tool in Python's re module for performing substitutions using regular expressions. It searches for patterns in strings and replaces them with specified text. …

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

    Learn how to use the Python re.sub () method to replace substrings in strings using regular expressions effectively.