how to delete the last word from the string

i have a title like this--


please note that there is no space between words and the dash.

i want to delete the last word from the string.
want to get title as


i tried the following
filename to filename (after getting it in the filename of course)
old pattern---$1-$2-$3
new pattern--$1-$2
but it does not work.

i tried guess values in title
it did not work

i tried filename to tag
gives me

Mayamma ahiri

how i miss the dash between words?

The correct syntax for filename - filename is
old pattern %1-%2-%3
new pattern %1-%2

Action: Format Value
Field: TITLE
Formatstring: $regexp(%title%,(.)-(.),$1)


Action: Replace with regular expression:
Field: TITLE
Regular Expression: (.)-(.)
Replace Matches With: $1