import re
#xy不为左边界
pattern = r'.*\Bxy'
v = re.match(pattern,'123 yuerxyr')
print(v)
v = re.match(pattern,'123 xyyuerr')
print(v)
#xy不为右边界
pattern = r'.*xy\B'
v = re.match(pattern,'wxyhelo')
print(v)
v = re.match(pattern,'wheloxy')
print(v)
