This is related to following question - Searching for Unicode characters in Python
I have string like this -
sentence = 'AASFG BBBSDC FEKGG SDFGF'
I split it and get list of words like below -
sentence = ['AASFG', 'BBBSDC', 'FEKGG', 'SDFGF']
I search of part of a word using following code and get whole word -
[word for word in sentence.split() if word.endswith("GG")]
It returns ['FEKGG']
Now i need to find out what is infront and behind of that word.
For example when i search for "GG" it returns ['FEKGG']
. Also it should able to get
behind = 'BBBSDC'
infront = 'SDFGF'