# \[X\] regexp problems

**URL:** <https://community.mp3tag.de/t/x-regexp-problems/17947>\
**Category:** No Bugs\
**Created:** [May 14, 2016, 5:49pm UTC](https://community.mp3tag.de/t/x-regexp-problems/17947 "2016-05-14T17:49:17Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![a23bed](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/a/43a26b/32.png) [@a23bed](https://community.mp3tag.de/u/a23bed)\
**Post date:** [May 14, 2016, 5:49pm UTC](https://community.mp3tag.de/t/x-regexp-problems/17947/1 "2016-05-14T17:49:17Z")

</div>

I'm not sure if this is a bug or an error on my part.

```
$regexp(%artist%,(\sF\w{0,8}[\.gt]\s|\sand\s|\swith\s),' & ',1)

```

(The actual code is longer but this just the relevant part.)

I use this in the Tag-Filename, to replace variations of 'Featuring', 'And', 'With' in %artist% names with an ampersand.

Notepad++ and all the online regex testers I've tried find the correct matching, except mp3tag 2.77

So All variations of 'Feat.' etc should be ' & '  
Here's some output example;

Maze Feat. Frankie Beverly --\> **Maze Feat. & Beverly.mp3**  
Maze with Frankie Beverly And More --\> Maze & Frankie Beverly & More.mp3  
Gene Testing Featuring The Somegthing --\> Gene Testing & The Somegthing.mp3  
Gene Testing Featg ag Somegthing --\> Gene Testing & ag Somegthing.mp3  
Gene Testing Feat. The ding Somegthing --\> Gene Testing Feat. The ding Somegthing.mp3  
Gene Testing Ft. The Somegthing More --\> Gene Testing Ft. The Somegthing More.mp3  
Gene Testing Feat The Somegthing --\> Gene Testing & The Somegthing.mp3  
Gene Testing And ding Somegthing --\> Gene Testing & ding Somegthing.mp3

_In the first line intrestingly 'Frankie' has been replaced._

Excellent program btw.

---

<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 14, 2016, 6:12pm UTC](https://community.mp3tag.de/t/x-regexp-problems/17947/2 "2016-05-14T18:12:51Z")

</div>

QUOTE (a23bed @ May 14 2016, 21:49) \<{POST\_SNAPBACK}\>

I'm not sure if this is a bug or an error on my part.

```
$regexp(%artist%,(\sF\w{0,8}[\.gt]\s|\sand\s|\swith\s),' & ',1)

```

...

  
Try:

$regexp(%artist%,'(\sF\w{0,8}[.gt]\s|\sand\s|\swith\s)',' & ',1)

---

<div class="post-metadata">

**Author:** ![DetlevD](https://community.mp3tag.de/user_avatar/community.mp3tag.de/detlevd/32/123_2.png) [@DetlevD](https://community.mp3tag.de/u/DetlevD)\
**Post date:** [May 14, 2016, 7:08pm UTC](https://community.mp3tag.de/t/x-regexp-problems/17947/3 "2016-05-14T19:08:03Z")

</div>

> [@a23bed](#):
>
> ... to replace variations of 'Featuring', 'And', 'With' in %artist% names with an ampersand. ...

 **ARTIST \<== $regexp(%ARTIST%,'\s(and|with|ft\.?|feat\.?|featuring)\s',' & ',1)** 

From:  
Artist Testing Featuring Someone  
Artist Testing Feat. Someone  
Artist Testing Feat Someone  
Artist Testing Ft. Someone More  
Artist Testing Ft Someone More  
Artist Testing And Someone  
Artist Testing with Someone  
Maze with Frankie Beverly And More

 

To:  
Artist Testing & Someone  
Artist Testing & Someone  
Artist Testing & Someone  
Artist Testing & Someone More  
Artist Testing & Someone More  
Artist Testing & Someone  
Artist Testing & Someone  
Maze & Frankie Beverly & More

 

DD.20160514.2308.CEST

---

<div class="post-metadata">

**Author:** ![a23bed](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/a/43a26b/32.png) [@a23bed](https://community.mp3tag.de/u/a23bed)\
**Post date:** [May 15, 2016, 5:07am UTC](https://community.mp3tag.de/t/x-regexp-problems/17947/4 "2016-05-15T05:07:56Z")

</div>

> [@ohrenkino](#):
>
> Try:
> 
> $regexp(%artist%,'(\sF\w{0,8}[.gt]\s|\sand\s|\swith\s)',' & ',1)

Thanks ohrenkino.  
Adding the single quotes actually works. Would have never thought of it.

Still on a learning curve, only discovered this fantastic program a few weeks back.

Thanks to all.

---

<div class="post-metadata">

**Author:** ![Florian](https://community.mp3tag.de/user_avatar/community.mp3tag.de/florian/32/5759_2.png) [@Florian](https://community.mp3tag.de/u/Florian)\
**Post date:** [December 28, 2018, 2:38pm UTC](https://community.mp3tag.de/t/x-regexp-problems/17947/5 "2018-12-28T14:38:07Z")

</div>

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