# Complete removal of the first string

**URL:** https://community.mp3tag.de/t/complete-removal-of-the-first-string/45514
**Category:** Support
**Created:** [May 22, 2019, 6:11pm UTC](https://community.mp3tag.de/t/complete-removal-of-the-first-string/45514 "2019-05-22T18:11:34Z")
**Posts on this page:** 17
**Page:** 1

<div class="post-metadata">

### Author: ![Zerow](https://community.mp3tag.de/user_avatar/community.mp3tag.de/zerow/32/11379_2.png) [@Zerow](https://community.mp3tag.de/u/Zerow)
#### Post date: [May 22, 2019, 6:11pm UTC](https://community.mp3tag.de/t/complete-removal-of-the-first-string/45514/1 "2019-05-22T18:11:34Z")

</div>

I have such action

`Replace expression "TITLE": "^\d*\s*\w* -> ""`

Its purpose is to remove the very first string from the TITLE tag  
` `  
` `  
However it ignores characters like ''`(`'' or '`'=`''; probably because of what I red at [Actions – Mp3tag Documentation](https://docs.mp3tag.de/actions)

> Literals
> 
> All characters except **. | \* ? + ( ) { } [] ^ $**.  
> These characters are literals when preceded by a "`\`".

I do not know what literals are but I tried adding e.g. this

`Replace expression "TITLE": "^\(* -> ""`

And it worked- I can now remove round opening bracket. So what is the problem?

A] I would have to multiply the regular expression for all of the listed above special characters, right?

B] If the first string happens to be enclosed in brackets [like `(SomethingThatNeedsToGo)` for example], then executing that action will only remove the very first character [the `(` sign], leaving me will the necessity to execute that action 2 more times  
` `  
` `  
So my question is- is there some expression that says

`Remove first string, whatever it is, until the first pause - and then also all the white spaces before the second string [because that second becomes then the first string and so no pause is needed in front of it]`

?

---

<div class="post-metadata">

### Author: ![ohrenkino](https://community.mp3tag.de/user_avatar/community.mp3tag.de/ohrenkino/32/4843_2.png) [@ohrenkino](https://community.mp3tag.de/u/ohrenkino)
#### Post date: [May 22, 2019, 6:26pm UTC](https://community.mp3tag.de/t/complete-removal-of-the-first-string/45514/2 "2019-05-22T18:26:20Z")

</div>

> [@Zerow](#):
>
> A] I would have to multiply the regular expression for all of the listed above special characters, right?

No, I don't think so. The restrictions apply to the regular expression but not to the evaluated string. So if you literally use any of the mentioned characters in the regular expression, then you have to take special care.

What I would find much more interesting: what do you mean by "first string"? How is that characterized? Examples would make it easier.

---

<div class="post-metadata">

### Author: ![Zerow](https://community.mp3tag.de/user_avatar/community.mp3tag.de/zerow/32/11379_2.png) [@Zerow](https://community.mp3tag.de/u/Zerow)
#### Post date: [May 22, 2019, 7:59pm UTC](https://community.mp3tag.de/t/complete-removal-of-the-first-string/45514/3 "2019-05-22T19:59:35Z")

</div>

> [@ohrenkino](#):
>
> [...]  
> What I would find much more interesting: what do you mean by "first string"? How is that characterized? Examples would make it easier.

Had I used `word` instead of ``string`, would make it my question more more clear?

` `  
` `

I need to get rid of anything and everything that is before the second word or a single character that constitutes as a second word. All must go, not only letters and digits. The code must stop with the last pause in the set of pauses when looking from the left

Example? An extended one:

The original file was named

`Main Title (Demo)`

During audio editing I change it temporarily to

`Main Title (Demo) = The Rock Theme (Demo)`

so that I would know what is what. But when I am done I need to be names as

`The Rock Theme (Demo)`

So I need and action that will execute on such file 4 times and not 6 or even more [because of the spaces]  
` `  
` `  
In 90% cases I will apply such action only 1 time- the example above is somewhat extreme. Also: yes I could do that manually- but if I have ten version of that file like "`Main Title (Demo) = The Rock Theme (Demo) A`", "`Main Title (Demo) = The Rock Theme (Demo) B`" etc. then a need arises for automation of the process  
` `  
` `  
[On a side note. I wanted to write "`Main_Title_(Demo)___ =_The_Rock_Theme_(Demo)`" where every "`_`" represents a pause, but this forum ignores every excess of them. How on this forum can we write more than one pause?]

---

<div class="post-metadata">

### Author: ![ohrenkino](https://community.mp3tag.de/user_avatar/community.mp3tag.de/ohrenkino/32/4843_2.png) [@ohrenkino](https://community.mp3tag.de/u/ohrenkino)
#### Post date: [May 22, 2019, 8:09pm UTC](https://community.mp3tag.de/t/complete-removal-of-the-first-string/45514/4 "2019-05-22T20:09:53Z")

</div>

So, if the pattern is always "space character space" then you could use an action of the type "Guess value"  
Source string: `$regexp(%title%,' . ',__)`  
Target string: %dummy%\_\_%title%

---

<div class="post-metadata">

### Author: ![Zerow](https://community.mp3tag.de/user_avatar/community.mp3tag.de/zerow/32/11379_2.png) [@Zerow](https://community.mp3tag.de/u/Zerow)
#### Post date: [May 22, 2019, 8:58pm UTC](https://community.mp3tag.de/t/complete-removal-of-the-first-string/45514/5 "2019-05-22T20:58:26Z")

</div>

> [@ohrenkino](#):
>
> So, if the pattern is always "space character space"

No, its "`character(s) space(s) character(s)`"

> [@ohrenkino](#):
>
> then you could use an action of the type "Guess value"  
> Source string: `$regexp(%title%,' . ',__)`  
> Target string: %dummy%\_\_%title%

I do not know how, but this guesses exactly, as with only 1 click [execution] the

`Main Title (Demo) = The Rock Theme (Demo)`

becomes

`The Rock Theme (Demo)`

But that is not what I was after, as with merely 1 click it should change to merely

`Title (Demo) = The Rock Theme (Demo)`

---

<div class="post-metadata">

### Author: ![ohrenkino](https://community.mp3tag.de/user_avatar/community.mp3tag.de/ohrenkino/32/4843_2.png) [@ohrenkino](https://community.mp3tag.de/u/ohrenkino)
#### Post date: [May 23, 2019, 4:22am UTC](https://community.mp3tag.de/t/complete-removal-of-the-first-string/45514/6 "2019-05-23T04:22:58Z")

</div>

> [@Zerow](#):
>
> `Main Title (Demo) = The Rock Theme (Demo)`
> 
> becomes
> 
> `The Rock Theme (Demo)`
> 
> But that is not what I was after, as with merely 1 click it should change to merely
> 
> `Title (Demo) = The Rock Theme (Demo)`

To remove the first word try an action of the type "Replace with regular expression", probably for TITLE  
Search string: `^\w `  
Replace string:  
(leave empty)

---

<div class="post-metadata">

### Author: ![Zerow](https://community.mp3tag.de/user_avatar/community.mp3tag.de/zerow/32/11379_2.png) [@Zerow](https://community.mp3tag.de/u/Zerow)
#### Post date: [May 23, 2019, 8:53pm UTC](https://community.mp3tag.de/t/complete-removal-of-the-first-string/45514/7 "2019-05-23T20:53:48Z")

</div>

Unfortunately this Replace with regular expression code

> Field: TITLE  
> Replace expression: ^\w  
> Replace matches with:

leaves the pause(s) after removed word. And what is more important [as the pauses I can remove in other ways], it is unable to process the bracket

Also altering it to `^\w*` does not make a difference

---

<div class="post-metadata">

### Author: ![ohrenkino](https://community.mp3tag.de/user_avatar/community.mp3tag.de/ohrenkino/32/4843_2.png) [@ohrenkino](https://community.mp3tag.de/u/ohrenkino)
#### Post date: [May 24, 2019, 4:58am UTC](https://community.mp3tag.de/t/complete-removal-of-the-first-string/45514/8 "2019-05-24T04:58:05Z")

</div>

> [@Zerow](#):
>
> it is unable to process the bracket

There are no brackets in your example:

> [@Zerow](#):
>
> `Main Title (Demo) = The Rock Theme (Demo)`
> 
> becomes
> 
> `The Rock Theme (Demo)`

> [@Zerow](#):
>
> leaves the pause(s) after removed word

You know the short comings of the forum software: it does not display trailing space characters.  
I am sure that you can add one after `\w`.

Here is something more to try:  
`$regexp('Main Title (Demo) = The Rock Theme (Demo2)','^.*? (.*)',$1)`  
which leads to  
Title (Demo) = The Rock Theme (Demo2)

---

<div class="post-metadata">

### Author: ![Zerow](https://community.mp3tag.de/user_avatar/community.mp3tag.de/zerow/32/11379_2.png) [@Zerow](https://community.mp3tag.de/u/Zerow)
#### Post date: [June 12, 2019, 10:17am UTC](https://community.mp3tag.de/t/complete-removal-of-the-first-string/45514/9 "2019-06-12T10:17:24Z")

</div>

> [@ohrenkino](#):
>
> Here is something more to try:  
> `$regexp('Main Title (Demo) = The Rock Theme (Demo2)','^.*? (.*)',$1)`

But if I am not mistaken, that would require to copy the FILENAME each time into the code, for each different file?

---

<div class="post-metadata">

### Author: ![ohrenkino](https://community.mp3tag.de/user_avatar/community.mp3tag.de/ohrenkino/32/4843_2.png) [@ohrenkino](https://community.mp3tag.de/u/ohrenkino)
#### Post date: [June 12, 2019, 10:42am UTC](https://community.mp3tag.de/t/complete-removal-of-the-first-string/45514/10 "2019-06-12T10:42:24Z")

</div>

> [@Zerow](#):
>
> But if I am not mistaken, that would require to copy the FILENAME each time into the code, for each different file?

Use the field variable instead.

---

<div class="post-metadata">

### Author: ![Zerow](https://community.mp3tag.de/user_avatar/community.mp3tag.de/zerow/32/11379_2.png) [@Zerow](https://community.mp3tag.de/u/Zerow)
#### Post date: [June 12, 2019, 12:35pm UTC](https://community.mp3tag.de/t/complete-removal-of-the-first-string/45514/11 "2019-06-12T12:35:32Z")

</div>

> [@ohrenkino](#):
>
> > [@Zerow](#):
> >
> > But if I am not mistaken, that would require to copy the FILENAME each time into the code, for each different file?
> 
> Use the field variable instead.

And by variable you mean TITLE?  
` `  
` `  
If what I am suppose to use is this

`Replace expression "TITLE": "$regexp('%TITLE%','^.*? (.*)',$1)"-> ""`

or this

`Replace expression "TITLE": "$regexp(%TITLE%,'^.*? (.*)',$1)"-> ""`

then it does not work, as nothing changes

---

<div class="post-metadata">

### Author: ![ohrenkino](https://community.mp3tag.de/user_avatar/community.mp3tag.de/ohrenkino/32/4843_2.png) [@ohrenkino](https://community.mp3tag.de/u/ohrenkino)
#### Post date: [June 12, 2019, 1:33pm UTC](https://community.mp3tag.de/t/complete-removal-of-the-first-string/45514/12 "2019-06-12T13:33:53Z")

</div>

> [@Zerow](#):
>
> then it does not work, as nothing changes

It the string is not in the title, then hard luck.  
I thought you talked about the filename? The variable for the filename is %\_filename%

---

<div class="post-metadata">

### Author: ![Zerow](https://community.mp3tag.de/user_avatar/community.mp3tag.de/zerow/32/11379_2.png) [@Zerow](https://community.mp3tag.de/u/Zerow)
#### Post date: [June 12, 2019, 1:44pm UTC](https://community.mp3tag.de/t/complete-removal-of-the-first-string/45514/13 "2019-06-12T13:44:23Z")

</div>

My mistake

My TITLE is almost always the same as FILENAME. But yes, I should had written TITLE  
``  
``  
Anyway thank you for the help. And if anyone in the future knows how to deal with this: then please post your ideas, as I will read them

---

<div class="post-metadata">

### Author: ![ohrenkino](https://community.mp3tag.de/user_avatar/community.mp3tag.de/ohrenkino/32/4843_2.png) [@ohrenkino](https://community.mp3tag.de/u/ohrenkino)
#### Post date: [June 12, 2019, 2:35pm UTC](https://community.mp3tag.de/t/complete-removal-of-the-first-string/45514/14 "2019-06-12T14:35:22Z")

</div>

> [@Zerow](#):
>
> `$regexp('Main Title (Demo) = The Rock Theme (Demo2)','^.*? (.*)',$1)`

Still works - so the contents of TITLE must be somehow different.  
You can test your regular expression in Convert\>Tag-Tag

---

<div class="post-metadata">

### Author: ![Zerow](https://community.mp3tag.de/user_avatar/community.mp3tag.de/zerow/32/11379_2.png) [@Zerow](https://community.mp3tag.de/u/Zerow)
#### Post date: [June 12, 2019, 3:10pm UTC](https://community.mp3tag.de/t/complete-removal-of-the-first-string/45514/15 "2019-06-12T15:10:26Z")

</div>

> [@ohrenkino](#):
>
> [...]  
> You can test your regular expression in Convert\>Tag-Tag

In there this ```$regexp(%TITLE%,'^._? (._)',$1)`` works

So I copied it from there to Action, to avoid mistakes- and there this very same code does not work

This reminds me of this ["Filename - Tag" ICON - #9 by Zerow](https://community.mp3tag.de/t/filename-tag-icon/16549/9), where depending on the way the data is going I either use Action [for FILENAME \> TITLE] or the `Tag - Filename` icon [for TITLE \> FILENAME]

---

<div class="post-metadata">

### Author: ![Zerow](https://community.mp3tag.de/user_avatar/community.mp3tag.de/zerow/32/11379_2.png) [@Zerow](https://community.mp3tag.de/u/Zerow)
#### Post date: [October 4, 2019, 3:11pm UTC](https://community.mp3tag.de/t/complete-removal-of-the-first-string/45514/16 "2019-10-04T15:11:15Z")

</div>

All in all I use now

`Regular expression "TITLE"; ^\d*\s*\w* -> ""`

and as a fail safe I compare what I see in TITLE in the Tag Panel with the FILENAME in see in the Main Window. It works- until it stops at charters like `(` and `=`  
``  
``  
I could work around that by proceeding the aforementioned code with

Replace "TITLE": "(" -\> "XXXX"  
Replace "TITLE": "=" -\> "XXXX"

but this would also transform all these characters that would be present anywhere else in a TITLE and not only at its beginning

---

<div class="post-metadata">

### Author: ![system](https://community.mp3tag.de/uploads/default/original/2X/c/ce7035d426cb755a7916793326d23b465222a407.png) [@system](https://community.mp3tag.de/u/system)
#### Post date: [February 9, 2026, 12:28pm UTC](https://community.mp3tag.de/t/complete-removal-of-the-first-string/45514/17 "2026-02-09T12:28:06Z")

</div>


