# Find and replace function in regular expression
# re.sub() find and replace function,that is global search function,that have 5 parameters

import re
sentence = "I love Avengers"
replace = re.sub(r"Avengers", "Justice league", sentence)
print(replace)
replace = re.sub(r"[a-zA-Z]","0",sentence)
print(replace)

replace = re.sub(r"[a-z]","0",sentence, flags= re.I)  # re.I case insensitive
print(replace)

replace = re.sub(r"[a-z]","0",sentence, 1 , flags= re.I)
print(replace)
8e1c7c02cd08e37cf176d577bce66e005b5f3e79
<mask token>

<mask token>
print(replace)
<mask token>
print(replace)
<mask token>
print(replace)
<mask token>
print(replace)

<mask token>
sentence = 'I love Avengers'
replace = re.sub('Avengers', 'Justice league', sentence)
print(replace)
replace = re.sub('[a-zA-Z]', '0', sentence)
print(replace)
replace = re.sub('[a-z]', '0', sentence, flags=re.I)
print(replace)
replace = re.sub('[a-z]', '0', sentence, 1, flags=re.I)
print(replace)

import re
sentence = 'I love Avengers'
replace = re.sub('Avengers', 'Justice league', sentence)
print(replace)
replace = re.sub('[a-zA-Z]', '0', sentence)
print(replace)
replace = re.sub('[a-z]', '0', sentence, flags=re.I)
print(replace)
replace = re.sub('[a-z]', '0', sentence, 1, flags=re.I)
print(replace)

# Find and replace function in regular expression
# re.sub() find and replace function,that is global search function,that have 5 parameters

import re
sentence = "I love Avengers"
replace = re.sub(r"Avengers", "Justice league", sentence)
print(replace)
replace = re.sub(r"[a-zA-Z]","0",sentence)
print(replace)

replace = re.sub(r"[a-z]","0",sentence, flags= re.I)  # re.I case insensitive
print(replace)

replace = re.sub(r"[a-z]","0",sentence, 1 , flags= re.I)
print(replace)