>>> s = 'D5ed3g3h{54345(63lkj24)234(34255fdsv]vdf]]}dsfsvS3fdszv' >>> start = s.find('{') >>> end = s.find('}') >>> if start < end: .. print s[start+1:end] .. 54345(63lkj24)234(34255fdsv]vdf]]