# Need help with regular expression

**URL:** https://community.mp3tag.de/t/need-help-with-regular-expression/8465
**Category:** Support
**Created:** [June 17, 2009, 12:26pm UTC](https://community.mp3tag.de/t/need-help-with-regular-expression/8465 "2009-06-17T12:26:46Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![MrDog](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/m/7993a0/32.png) [@MrDog](https://community.mp3tag.de/u/MrDog)
#### Post date: [June 17, 2009, 12:26pm UTC](https://community.mp3tag.de/t/need-help-with-regular-expression/8465/1 "2009-06-17T12:26:46Z")

</div>

I had a problem with disk crashes and general computer mayhem a while back. A bunch of my tags got screwed up, and now I want to fix them. The artist and year fields have been particularly affected. They read Bob Marley/Bob Marley/Bob Marley (anywhere from 2-4 repeats) or 1992\\1992. Sometimes there is a blank character box, too.

Is there an expression that will delete the slashes and repeated values?

Thanks in advance,

Mr. Dog

---

<div class="post-metadata">

### Author: ![RevRagnarok](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/r/b487fb/32.png) [@RevRagnarok](https://community.mp3tag.de/u/RevRagnarok)
#### Post date: [June 17, 2009, 6:08pm UTC](https://community.mp3tag.de/t/need-help-with-regular-expression/8465/2 "2009-06-17T18:08:00Z")

</div>

> [@Mr. Dog](#):
>
> I had a problem with disk crashes and general computer mayhem a while back. A bunch of my tags got screwed up, and now I want to fix them. The artist and year fields have been particularly affected. They read Bob Marley/Bob Marley/Bob Marley (anywhere from 2-4 repeats) or 1992\\1992. Sometimes there is a blank character box, too.
> 
> Is there an expression that will delete the slashes and repeated values?

Well, I don't have MP3Tag in front of me, but you can try:  
Search:  
([^/]_)(/\1)_  
Replace:  
$1

Again, this is off the top of my head, I'm at work so cannot check this. You would do the same for the backslashes, replace the first two / with \ but NOT the last one at \1.

Explanation (highlight): Capture greedily everything up to a slash into $1. Then capture the string of / followed by what you already captured into $1. Do it as many times as you can.

---

<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:21pm UTC](https://community.mp3tag.de/t/need-help-with-regular-expression/8465/3 "2026-02-09T12:21:35Z")

</div>


