# Some Regex Issues

**URL:** https://community.mp3tag.de/t/some-regex-issues/10638
**Category:** Support
**Created:** [August 12, 2010, 1:58pm UTC](https://community.mp3tag.de/t/some-regex-issues/10638 "2010-08-12T13:58:41Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![Phixion](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/p/dc4da7/32.png) [@Phixion](https://community.mp3tag.de/u/Phixion)
#### Post date: [August 12, 2010, 1:58pm UTC](https://community.mp3tag.de/t/some-regex-issues/10638/1 "2010-08-12T13:58:41Z")

</div>

Hey guys,

I currently use this to correctly capitalize certain words:

FIELD: \_ALL  
REGEX: (?\<!-)\s(a|an|and|as|at|by|but|for|in|of|on|or|out|the|to)(?=\s)  
REPLACE MATCHES WITH: $lower($0)

I also use this to capitalize each first and last word regardless of what it is:

FIELD: \_ALL  
REGEX: \b(\l)(\w\*?)$  
REPLACE MATCHES WITH: $upper($1)$2  
CASE SENSITIVE COMPARISON: Yes

I'm using this to capitalize letters after certain characters:

FIELD: _ALL  
CASE CONVERSION: Mixed  
WORDS BEGIN FROM/AFTER ANY OF: (-_.[

The problem is this also names my files .Mp3 rather than .mp3, I need a way to tell it to not capitalize .mp3.

I also need a way to search for _exactly_ what I type in the filter (case sensitive), at the moment it seems to throw a bunch of results back regardless of the case I use in the search.

Many thanks.

PS: Good to see the forums back ![:wub:](https://community.mp3tag.de/uploads/default/original/1X/9d52539911b96a045b8e7016a3cf8335067dd973.gif ":wub:")

---

<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: [August 12, 2010, 2:30pm UTC](https://community.mp3tag.de/t/some-regex-issues/10638/2 "2010-08-12T14:30:59Z")

</div>

> [@Phixion](#):
>
> ... I'm using this to capitalize letters after certain characters:  
> FIELD: _ALL  
> CASE CONVERSION: Mixed  
> WORDS BEGIN FROM/AFTER ANY OF: (-_.[
> 
> The problem is this also names my files .Mp3 rather than .mp3, I need a way to tell it to not capitalize .mp3. ...

You can add an action that will re-lower the file extension using a formula like this:  
\_FILENAME\_EXT \<== $lower(%\_FILENAME\_EXT%)  
... but I do not know how to do it in detail .. the summer abstinence put me totally away from Mp3tag scripting.

Hmm, maybe this way works ...  
_Actiontype 4:_ **Replace with regular expression**  
_Field:_ **\_FILENAME**  
_Regular expression:_ **..\*$**  
_Replace matches with:_ **\L$0**

[\_] Case sensitive comparison

> [@Phixion](#):
>
> ... I also need a way to search for _exactly_ what I type in the filter (case sensitive), at the moment it seems to throw a bunch of results back regardless of the case I use in the search. ...

[Filter expressions](https://community.mp3tag.de/t/10080/4)

DD.20100812.1858.CEST

---

<div class="post-metadata">

### Author: ![Phixion](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/p/dc4da7/32.png) [@Phixion](https://community.mp3tag.de/u/Phixion)
#### Post date: [August 12, 2010, 3:52pm UTC](https://community.mp3tag.de/t/some-regex-issues/10638/3 "2010-08-12T15:52:29Z")

</div>

Thanks mate, but the regex you provided is giving me lower case after every ".", e.g. "Feat. Pogo" is becoming "Feat. pogo".

EDIT: I managed to get around this by applying my filters to album/title only then converting tag \> filename.

---

<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: [August 13, 2010, 6:52am UTC](https://community.mp3tag.de/t/some-regex-issues/10638/4 "2010-08-13T06:52:33Z")

</div>

> [@Phixion](#):
>
> Thanks mate, but the regex you provided is giving me lower case after every ".", e.g. "Feat. Pogo" is becoming "Feat. pogo".  
> EDIT: I managed to get around this by applying my filters to album/title only then converting tag \> filename.

I am glad to hear that you have managed something which works for you.

I have looked again into the problem of changing the letter case of the file extension only and have reworked my proposal:

_Actiontype 4:_ **Replace with regular expression**  
_Field:_ **\_FILENAME**  
_Regular expression:_ **^(.+)(..+)$**  
_Replace matches with:_ **$1\L$2**

[\_] Case sensitive comparison

A filename like "Some.Test.File.MP3" or "Some.Test.File.Mp3" will be converted to "Some.Test.File.mp3".

DD.20100813.1052.CEST

There is another simple solution for just lower casing the file extension using the converter "Tag - Filename".

 

**Convert** | **Tag - Filename** | **ALT+1**  
_Select format string_  
Format string:  
**%\_FILENAME%**

 

Because of Mp3tag's "behind the curtain" feature of formatting the file extension to lower case, a given filename of "some OTHER test file. **MP3**" will be converted to "some OTHER test file. **mp3**".

DD.20100813.1404.CEST

---

<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:22pm UTC](https://community.mp3tag.de/t/some-regex-issues/10638/5 "2026-02-09T12:22:29Z")

</div>


