import re
match = re.search('^(?!.*opt3)FileName\.abc', 'FileName.abc 0 opt1 opt2 opt4')
if match:
	print(re.group())