import re

template = '..? love P'


# def matched(template, string):
#     if re.match(template, string) is None:
#         return False
#     else:
#         return True
#
# string_1 = 'I love Python 3'
# string_2 = 'i love Pitsaw'
# string_3 = 'we love Papuan'
# string_4 = 'we love php'
#
# print(matched(template, string_1))
# print(matched(template, string_2))
# print(matched(template, string_3))
# print(matched(template, string_4))