How to search if a substring is matching to the dict value,
I am able to match the whole string with dict value, but how can we match the substring and the value in the dict.
EX = {
'TYPE_1': ['abc'],
'TYPE_2': ['bbc' , 'lmn'],
'TYPE_3': ['abcde'],
'TYPE_4': ['dcvabc']
}
m1 = "Hi abc , welcome"
m2 = "This i new session named: dcvabc"
m3 = "welcome to the class lmn"
Expecting output as below:
if m1 string is compared it must return key TYPE_1
if m2 string is compared it much return key TYPE_4
if m2 string is compared it much return key TYPE_2
Please suggest on this.