how to delete the last word from the string


#1

i have a title like this--

Mayamma-ahiri-extraordinary

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

Mayamma-ahiri

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
%title%-%title%-%dummy%
gives me

Mayamma ahiri

how i miss the dash between words?


#2

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


#3

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

or

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