# Strip leading numbers and dash

**URL:** https://community.mp3tag.de/t/strip-leading-numbers-and-dash/67770
**Category:** Support
**Created:** [March 9, 2025, 1:54pm UTC](https://community.mp3tag.de/t/strip-leading-numbers-and-dash/67770 "2025-03-09T13:54:34Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![AudioBabble](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/a/41988e/32.png) [@AudioBabble](https://community.mp3tag.de/u/AudioBabble)
#### Post date: [March 9, 2025, 1:54pm UTC](https://community.mp3tag.de/t/strip-leading-numbers-and-dash/67770/1 "2025-03-09T13:54:34Z")

</div>

Hello all,

How do I strip leading numbers and dash from the TITLE tag?

I've done filename \> tag, now I'd like to use 'replace with regex' to strip the leading numbers and dash from the TITLE tag.

Sorry, this has probably been asked a zillion times before (even by me!), but google search led me down a rabbit hole of confusion!!

Do I need something in the regular expression box **and** something in the 'replace matches with' box?

format is: ' 01-Concert Intro '

---

<div class="post-metadata">

### Author: ![AudioBabble](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/a/41988e/32.png) [@AudioBabble](https://community.mp3tag.de/u/AudioBabble)
#### Post date: [March 9, 2025, 2:01pm UTC](https://community.mp3tag.de/t/strip-leading-numbers-and-dash/67770/2 "2025-03-09T14:01:42Z")

</div>

sorted (for this case anyway)...

simply removed the first three characters from the title tag with:

```auto
^.{3}

```

---

<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: [March 9, 2025, 2:02pm UTC](https://community.mp3tag.de/t/strip-leading-numbers-and-dash/67770/3 "2025-03-09T14:02:50Z")

</div>

Or see here - as it is safer to look for digits than just any character

> [@Strip leading numbers from filenames to create titles](https://community.mp3tag.de/t/strip-leading-numbers-from-filenames-to-create-titles/7869):
>
> I could not for the life of me figure out this multistage process. After a lot of trouble (even though I am a professional programmer!) I finally got it working. I will describe the steps as best possible, having taken my steps from others' postings. I am sure there is an easier way to do this! Goal: Given filename: 01 SongName.mp3 Create title: SongName Select Actions from the Convert menu. Click the Star button to create a new Action Group. I named mine: Strip leading numbers Click…

---

<div class="post-metadata">

### Author: ![AudioBabble](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/a/41988e/32.png) [@AudioBabble](https://community.mp3tag.de/u/AudioBabble)
#### Post date: [March 9, 2025, 2:09pm UTC](https://community.mp3tag.de/t/strip-leading-numbers-and-dash/67770/4 "2025-03-09T14:09:38Z")

</div>

thanks (admittedly i was a bit ham-fisted)

The format of no spaces between number, dash and track title is a bit of a bugger.

Normally I can do filename \> tag ' %track% %dummy% ' to get track numbers.

In this case I had to do replace with regex: \_FILENAME,  
Regex:  
`(?<!\s)-|-(?!\s)`

Replace with:  
`" - "`

**then** I was able to do the usual filename \> tag for the track numbers.

---

<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: [March 9, 2025, 2:13pm UTC](https://community.mp3tag.de/t/strip-leading-numbers-and-dash/67770/5 "2025-03-09T14:13:30Z")

</div>

> [@AudioBabble](#):
>
> 01-Concert Intro

With  
%dummy%-%title%  
should also lead to success  
Or a regular expression like  
`\d+\s*-\s*`  
would delete the leading number and a hyphen with or without spaces if you leave the "Replace with" empty.

---

<div class="post-metadata">

### Author: ![LyricsLover](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/l/c6cbf5/32.png) [@LyricsLover](https://community.mp3tag.de/u/LyricsLover)
#### Post date: [March 9, 2025, 3:06pm UTC](https://community.mp3tag.de/t/strip-leading-numbers-and-dash/67770/6 "2025-03-09T15:06:21Z")

</div>

> [@AudioBabble](#):
>
> How do I strip leading numbers and dash from the TITLE tag?
> 
> ^.{3}

This only works for exactly the first 3 characters at the beginning of a TITLE tag.

This will NOT work as expected for this examples:  
` 01-Concert Intro` -\> `-Concert Intro`  
`1-Concert Intro` -\> `oncert Intro`  
`123-Concert Intro` -\> `-Concert Intro`

It does not look for a dash and not for various amount of digits.

Please be careful with this "solution".

---

<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: [March 9, 2025, 3:09pm UTC](https://community.mp3tag.de/t/strip-leading-numbers-and-dash/67770/7 "2025-03-09T15:09:45Z")

</div>

> [@AudioBabble](#):
>
> Normally I can do filename \> tag ' %track% %dummy% ' to get track numbers.

This only works for filenames with a space in the filename.  
`01-Concert Intro ` with %track% %dummy% would lead to have 01-Concerto in TRACK

---

<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: [April 8, 2025, 3:09pm UTC](https://community.mp3tag.de/t/strip-leading-numbers-and-dash/67770/8 "2025-04-08T15:09:52Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
