def feat_tokens(for_artist=True):
 feat_words = ['ft', 'featuring', 'feat', 'feat.', 'ft.']
 if for_artist:
  feat_words += ['with', 'vs', 'and', 'con', '&']
 return '(?<=\\s)(?:{0})(?=\\s)'.format('|'.join((re.escape(x) for x in feat_words)))

def feat_tokens ( for_artist = True ) : feat_words = [ 'ft' , 'featuring' , 'feat' , 'feat.' , 'ft.' ] if for_artist : feat_words += [ 'with' , 'vs' , 'and' , 'con' , '&' ] return '(?<=\\s)(?:{0})(?=\\s)' . format ( '|' . join ( ( re . escape ( x ) for x in feat_words ) ) )
return a regular expression that matches phrases like "featuring" that separate a main artist or a song title from secondary artists .