Isolate song title with regexp

esbenam's icon

I have this string from a scene name: name "Song title one 106 BPM"

And i want it to be just "Song title one". The following regex is working, but I think there is an easier and faster way, but I don't know how.

regexp name\s([a-zA-Z|\s]*)[0-9|.]*\sBPM

Any help is appreciated

broc's icon

I think this would work too

regexp name\s([a-zA-Z|\s]*)\s.*

esbenam's icon

Yup it does / thank you

I found an additional issue though.

If I for some reason don't want to put in a tempo in one song title it will fail. Can I make it so the 123 BMP is optional?

esbenam's icon

regexp name([a-zA-Z|\s]*)? of course worked.

Thank you :)