Find text in string, delete it and everything after it

I am sure this is possible, just cannot get it to work.
In the tag “UNSYNCEDLYRICS” I want to find the first occurrence of text in the string say “threebears” then delete everything including the text to the end
For example “Once upon a time there was threebears mummy bear, daddy bear”
To “Once upon a time there was”
Don’t mind creating a new action , but ideally would like to incorporate into an Export Script I have written in File – Export

Create an action of the type "Replace with regular expression" or use a $regexp() statement:
Search string: threebears .*$
Replace string:
(leave empty)


Convert "Tag - Tag" ... or ... Action "Format value" Field: UNSYNCEDLYRICS Formatstring: $trimRight($left(%UNSYNCEDLYRICS%,$sub($strstr(%UNSYNCEDLYRICS%,'threebears'),1))) ... or ... Formatstring: $trimRight($regexp(%UNSYNCEDLYRICS%,'^(.*?)threebears.*','$1')) ... or ... Formatstring: $trimRight($regexp(%UNSYNCEDLYRICS%,'threebears.*',)) From: 'eng||Once upon a time there was threebears mummy bear, daddy bear ...' To : 'eng||Once upon a time there was'


Thanks to you both, Excellent, just been playing around with what I wanted to achieve, and now working.
Thanks for your help – appreciated.