I'm trying to very the presence of a series of given substring within a larger string in python 3.7 using Regular Expression. The problem is similar to this:
import re
LargeString = 'Lorem ipsum is simply dummy text of the printing and typesetting industry RE-2 and other Lorem ipsum RE-44'
substringSet = ['RE-2','RE-44','RE-4']
for _c in substringSet:
_idxDevice = re.findall(_c,LargeString)
Clear in this way the regular expression will give a positive answer for all the elements of the substringSet whereas I would like to be able to distinguish the fact that RE-44 is present in the LargeString wherease RE-4 not. Any idea?