Remove part of Tag


#1

Having searched the forums I thought I’d worked this out – didn’t, haven't – messed up.

Have title tag for example
“Happy Birthday, Sweet Sixteen - Neil Sedaka”
Want to remove “ - Neil Sedaka”

Created action
Field = Title
Regular Expression = (.)-(.)
Replace matches with = $trim($1)

Using this action title is renamed
“Happy Birthday”

Seems to work OK if there is no “, “ in title
i.e. “Happy Birthday Sweet Sixteen - Neil Sedaka”
Returns “Happy Birthday Sweet Sixteen”

Need to be shown the error of my ways – big please


#2

There's currently a problem when a comma enters a function in the RegEx Action.

But you can just use a different expression that has the same effect, like
RE: \s+-.+$
Replace:


#3

Thanks for that.

Luckily didn't mess up too many. This should mean that I don't mess up any more.

Cheers


#4

Man, I am really trying to understand this. I am trying to trim the last 7 characters from my album field. I have been using a regular expression to trim the first three characters of the title like so:

Field = Title
Regular Expression = ^.{3}
Replace matches with = ""

Very simple and straight forward. I thought that it would be just as simple to do the last 7 (not trailing spaces " [YYYY]" with $.{7} . This obviously is not working. I am not good at scripting, I have been reding the forum for about an hours and I am just not getting it.

Thanks in advance.


#5

You could have seen from my post that the end sign $ is also acutally put at the end!
.{7}$


#6

Damn I hate it when it is something simple like that. Thanks for the help.