Forums > Max For Live

Isolate song title with regexp

Mar 23 2013 | 10:50 am

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

Mar 23 2013 | 12:57 pm

I think this would work too

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

Mar 23 2013 | 1:12 pm

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?

Mar 23 2013 | 1:21 pm

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

Thank you :)

Viewing 4 posts - 1 through 4 (of 4 total)

Forums > Max For Live