import re
def contains_abbrev(abbrev, text):
	text = text.lower()
	if not abbrev.isupper():
		return False
	cnt = 0
	for c in abbrev.lower():
		if text.find(c) > -1:
			text = text[text.find(c):]
			cnt += 1
			continue
	return cnt == len(abbrev)
	
text= "Some example text (SET) that demonstrates what I'm looking for. Energy system models (ESM) are used to find specific optima (SCO). Some say computer systems (CUST) are cool. In the summer playing outside (OUTS) should be preferred. Stupid example(s) Stupid example(S) Not stupid example (NSEMPLE), bad example (Bexle)"
abbrev_rx = r'\b(([A-Z])\w*(?:\s+\w+)*?)\s*\((\2[A-Z]*)\)'
print( [x.group() for x in re.finditer(abbrev_rx, text, re.I) if contains_abbrev(x.group(3), x.group(1))] )
