Python: Regex Reference
Python: Regex re.subn
By Xah Lee. Date:
2022-07-30
. Last updated:
2022-07-31
.
re.subn(
…
)
Same as
re.sub
, except returns a tuple:
(
new_string
,
number_of_substitution_made
)
.
Python, Regex Functions
Python: Regex re.search
Python: Regex re.match
Python: Regex re.split
Python: Regex re.findall
Python: Regex re.finditer
Python: Regex re.sub
Python: Regex re.subn
Python: Regex re.escape
Python, Regular Expression
Python: Regex
Python: Regex Functions
Python: Regex Object and Methods
Python: Regex Match Object
Python: Regex Syntax
Python: Regex Flags
Python
Search 🔍
Overview
Python 3
Python 2
Python 2 and 3 Difference
Source Code Encoding
Help
Print Version
Builtin Help
Comment
Comment
String
String
Unicode 🐍
Arithmetic
Operators
Assignment
Convert Int, Float, String
Complex Numbers
Boolean
True, False
Boolean Operators
Test Equality
Test Order
Conditional
If Else
Loop, Iteration
Loop
Data Structure
List
Dictionary
Tuple
Sets
Sequence Types
JSON
Function and Class
Function
Lambda
Closure
Decorator
Class
Object, ID, Type
Module
Import Module
Show Module Doc
List Module's Functions
List Modules
Module Search Paths
Write a Module
Misc
Datetime
Timing, Measure Speed
Regex
Regex
Regex Reference
Read Write File
Read File
Write File
Walk Directory
File Path
Find Script Path
Unicode, Encoding
Get Unicode Name, Codepoint
Convert File Encoding
Text Processing
Find Replace in dir
Find Replace by Regex
Count Word Frequency
Web
Send Email
GET Web Page
Web Crawler
HTTP POST
Misc
Auto Format Code
Get Env Var
System Call
Decompress Gzip
Transpose Matrix
Check Page Load Size
Thumbnail Generation