# Case Conversion with regex

**URL:** https://community.mp3tag.de/t/case-conversion-with-regex/2745
**Category:** Support
**Created:** [January 8, 2006, 3:23pm UTC](https://community.mp3tag.de/t/case-conversion-with-regex/2745 "2006-01-08T15:23:35Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![k00lice](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/k/5fc32e/32.png) [@k00lice](https://community.mp3tag.de/u/k00lice)
#### Post date: [January 8, 2006, 3:23pm UTC](https://community.mp3tag.de/t/case-conversion-with-regex/2745/1 "2006-01-08T15:23:35Z")

</div>

First of all, this program is great. Thanks for working so hard.

Anyway, this is what I have a problem with.  
I am trying to convert cases of tags to mixed tags.

Example)  
I AM SO gooD And a Dog of John -\> I Am So Good And A Dog Of John  
:This is how you get when you use mixed conversion.

I do not want some of words to convert to Mixed cases, such as A, An, Of.  
So my target is something like this...

Target)  
I Am So Good and a Dog of John

I put this regular expression after mixed case conversion

```
Regex (.*) (a |the |of |to |an |and ) and replace with $1 \l$2

```

But this doesn't work as I wanted it to be

Result)  
I Am So Good And A Dog of John

The expression above just convert last a, an, of or whatever, but ignores any words before that.

Would you please let me know how I can manage this?

---

<div class="post-metadata">

### Author: ![dano](https://community.mp3tag.de/user_avatar/community.mp3tag.de/dano/32/6_2.png) [@dano](https://community.mp3tag.de/u/dano)
#### Post date: [January 8, 2006, 3:38pm UTC](https://community.mp3tag.de/t/case-conversion-with-regex/2745/2 "2006-01-08T15:38:52Z")

</div>

Try this approach:

> [@](#):
>
> RegExp:  
> \s(a|the|of|to|an|and)(?=\s)  
> Replace:  
> $lower($0)

---

<div class="post-metadata">

### Author: ![k00lice](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/k/5fc32e/32.png) [@k00lice](https://community.mp3tag.de/u/k00lice)
#### Post date: [January 9, 2006, 1:17am UTC](https://community.mp3tag.de/t/case-conversion-with-regex/2745/3 "2006-01-09T01:17:02Z")

</div>

Thanks, Dano! It works and very simple. GREAT!!

---

<div class="post-metadata">

### Author: ![immr](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/i/7ba0ec/32.png) [@immr](https://community.mp3tag.de/u/immr)
#### Post date: [February 8, 2007, 7:58am UTC](https://community.mp3tag.de/t/case-conversion-with-regex/2745/4 "2007-02-08T07:58:37Z")

</div>

I tried to add to this so that it won't change to lower case when the word follows a colon, parenthesis, dash or bracket.

(e.g. (This Could Be) The Last Time; Alpha Omega (The Beginning); Interstellar Overdrive: The Alternate Masters)

So I added to RegExp: [^:()[]-]\s(a|the|of|to|an|and)(?=\s)  
and left Replace as: $lower($0)

This seemed to work fine until it came across "Yes, The River Knows"

The comma seems to cause a problem: instead of "Yes, the River Knows" I get "Yes River Knows"

I haven't been able to get it to work right, can anyone help out? Thanks.

---

<div class="post-metadata">

### Author: ![immr](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/i/7ba0ec/32.png) [@immr](https://community.mp3tag.de/u/immr)
#### Post date: [February 14, 2007, 4:21am UTC](https://community.mp3tag.de/t/case-conversion-with-regex/2745/5 "2007-02-14T04:21:25Z")

</div>

I figured it out.

---

<div class="post-metadata">

### Author: ![dano](https://community.mp3tag.de/user_avatar/community.mp3tag.de/dano/32/6_2.png) [@dano](https://community.mp3tag.de/u/dano)
#### Post date: [February 14, 2007, 2:59pm UTC](https://community.mp3tag.de/t/case-conversion-with-regex/2745/6 "2007-02-14T14:59:45Z")

</div>

Good for you, but you might want to tell the others!  
Not really a useful post without the information.

---

<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:19pm UTC](https://community.mp3tag.de/t/case-conversion-with-regex/2745/7 "2026-02-09T12:19:35Z")

</div>


