import re

s = "Take up one idea.One idea only"

# FINDING THE FIRST SUBSTRING THAT MATCHES THE REGEX
res = re.search(r'o\w\w', s)
print(res.group())


# FINDING ALL THE SUBSTRINGS THAT MATCH THE REGEX
res2 = re.findall(r'o\w\w', s)
print(res2)


# TESTING IF THE STRING MATCHES THE REGEX
res3 = re.match(r'T\w\w', s)
print(res3.group())


# SPLITTING
res4 = re.split(r'\.', s)
print(res4)


# REPLACING ONE STRING FOR ANOTHER
res5 = re.sub(r'one', 'two', s)
print(res5)


# QUANTIFIERS
res6 = re.findall(r'O\w{2,}', s)
print(res6)


906fd659230072a0bad9b0962c5163b7757a1281
<mask token>

<mask token>
print(res.group())
<mask token>
print(res2)
<mask token>
print(res3.group())
<mask token>
print(res4)
<mask token>
print(res5)
<mask token>
print(res6)

<mask token>
s = 'Take up one idea.One idea only'
res = re.search('o\\w\\w', s)
print(res.group())
res2 = re.findall('o\\w\\w', s)
print(res2)
res3 = re.match('T\\w\\w', s)
print(res3.group())
res4 = re.split('\\.', s)
print(res4)
res5 = re.sub('one', 'two', s)
print(res5)
res6 = re.findall('O\\w{2,}', s)
print(res6)

import re
s = 'Take up one idea.One idea only'
res = re.search('o\\w\\w', s)
print(res.group())
res2 = re.findall('o\\w\\w', s)
print(res2)
res3 = re.match('T\\w\\w', s)
print(res3.group())
res4 = re.split('\\.', s)
print(res4)
res5 = re.sub('one', 'two', s)
print(res5)
res6 = re.findall('O\\w{2,}', s)
print(res6)

import re

s = "Take up one idea.One idea only"

# FINDING THE FIRST SUBSTRING THAT MATCHES THE REGEX
res = re.search(r'o\w\w', s)
print(res.group())


# FINDING ALL THE SUBSTRINGS THAT MATCH THE REGEX
res2 = re.findall(r'o\w\w', s)
print(res2)


# TESTING IF THE STRING MATCHES THE REGEX
res3 = re.match(r'T\w\w', s)
print(res3.group())


# SPLITTING
res4 = re.split(r'\.', s)
print(res4)


# REPLACING ONE STRING FOR ANOTHER
res5 = re.sub(r'one', 'two', s)
print(res5)


# QUANTIFIERS
res6 = re.findall(r'O\w{2,}', s)
print(res6)

