Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

Python RegEx Subn – re.subn()

import re

print(re.subn('ub', '~*', 'Subject has Uber booked already'))

t = re.subn('ub', '~*', 'Subject has Uber booked already',
			flags=re.IGNORECASE)
print(t)
print(len(t))

# This will give same output as sub() would have
print(t[0])
Source by softhunt.net #
 
PREVIOUS NEXT
Tagged: #Python #RegEx #Subn
ADD COMMENT
Topic
Name
3+1 =