python regex songs -


sorry, need finding right regular expression this. want recognize via regex if following format in string:

artist - title (something)

examples:

"ellie goulding - gracious (the chainsmokers remix)" "the xx - got love (florence , machine cover)" "neneh cherry - (loco dice remix)" "my chemical romance - famous last words (video)" 

i have been trying haven't been able find right regular expression.

regex = "[a-za-z0-9\s]+[\-]{1}[a-za-z0-9\s]+[\(]{1}[\s]*[a-za-z0-9\s]*[\)]{1}" 

help please!

i do

regex = r"^[^\-]*-[^\(]*\([^\)]*\)$" 

Comments

Popular posts from this blog

java - Spring Data JPA: Why findOne(id) executing delete query internally? -

python - Mongodb How to add addtional information when aggregating? -

java - Incorrect order of records in M-M relationship in hibernate -