# RegExp Help

**URL:** https://community.mp3tag.de/t/regexp-help/13696
**Category:** Support
**Created:** [July 28, 2012, 1:40am UTC](https://community.mp3tag.de/t/regexp-help/13696 "2012-07-28T01:40:18Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![niche99](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/n/c67d28/32.png) [@niche99](https://community.mp3tag.de/u/niche99)
#### Post date: [July 28, 2012, 1:40am UTC](https://community.mp3tag.de/t/regexp-help/13696/1 "2012-07-28T01:40:18Z")

</div>

Hi,

I have tried the following with no success

regexp: (\s\<!--coloro:#A0522D--\>'.)  
replace: \U$0

and replaced the red character with [, " and ' with no consistent success.

For example the above regexp produces this:  
The 'torchum' Never Stops -\> The 'Torchum' Never Stops \<- which I want.  
The Massive Improve'lence -\> The Massive Improve'Lence \<- which I don't want.

Any help would be appreciated.  
Regards,  
niche99

---

<div class="post-metadata">

### Author: ![stevehero](https://community.mp3tag.de/user_avatar/community.mp3tag.de/stevehero/32/337_2.png) [@stevehero](https://community.mp3tag.de/u/stevehero)
#### Post date: [July 28, 2012, 8:20am UTC](https://community.mp3tag.de/t/regexp-help/13696/2 "2012-07-28T08:20:15Z")

</div>

> [@niche99](#):
>
> Hi,
> 
> I have tried the following with no success
> 
> regexp: (\s\<!--coloro:#A0522D--\>'.)  
> replace: \U$0  
> ....  
> For example the above regexp produces this:  
> The 'torchum' Never Stops -\> The 'Torchum' Never Stops \<- which I want.  
> The Massive Improve'lence -\> The Massive Improve'Lence \<- which I don't want.

Your action could not possibly work as \U in the replace is not how you go about doing this. It only works to find a non-upper case character anyway.  
See [https://docs.mp3tag.de/actions/replace-regexp](https://docs.mp3tag.de/actions/replace-regexp)

For your problem try this.

Begin Action Group **\_Script Test#TEST**

**Action #1** _Actiontype 4:_ **Replace with regular expression** _Field \_\_\_\_\_\_\_\_\_\_\_\_\_\_:_ **TITLE** _Regular expression \_:_ **\s+'** (.) 

_Replace matches with:_ **$upper** ($1)

 [\_] Case sensitive comparison 

End Action Group **\_Script Test#TEST** (1 Action)

 

**This finds:**

 **\s+**** \s **Space character unlimited times** + ****'** The ' character (.)Start capture ( with . representing any character and ) closing the capture

**Replaces:**

 **$upper** Converts ($1) Captured like above  

See [https://docs.mp3tag.de/scripting/#string-functions](https://docs.mp3tag.de/scripting) for more info.

---

<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: [July 28, 2012, 9:10am UTC](https://community.mp3tag.de/t/regexp-help/13696/3 "2012-07-28T09:10:02Z")

</div>

> [@niche99](#):
>
> ... The 'torchum' Never Stops -\> The 'Torchum' Never Stops \<- which I want.  
> The Massive Improve'lence -\> The Massive Improve'Lence \<- which I don't want. ...

The problem seems to be the punctuation mark "Apostroph", which is a word delimiter.  
Therefore it is not so easy to code a lookbehind or lookahead.  
But there is a workaround, which can help quickly.

For the capitalization use the function $caps2() and subsequently do the trick using the function $regexp().

**$regexp($caps2(%FIELD%,' (["'),'(\s\x27)(.)','$1\u$2')**

... or ...

**$regexp($caps2(%FIELD%,' (["'),'\s\x27.','\U$0')**

... or ...

**$regexp(%FIELD%,'(^|\x20\x27|[[(\x20\x22])(.)','$1\u$2')**

Apply the above expressions by action "Format value" or by converter "Tag - Tag".

If you want to apply the capitalization rule to all tag-fields at once, then use ...

_Actiontype 4:_ **Replace with regular expression** 

_Field \_\_\_\_\_\_\_\_\_\_\_\_\_\_:_ **\_TAG**  
_Regular expression \_:_ **(^|\x20\x27|[[(\x20\x22])(.)**  
_Replace matches with:_ **$1\u$2**

 [\_] Case sensitive comparison

**Examples**  
**the 'torchum' never stops -\> The 'Torchum' Never Stops  
the massive improve'lence -\> The Massive Improve'lence  
aaa bbb(ccc[ddd"eee 'fff -\> Aaa Bbb(Ccc[Ddd"Eee 'Fff  
aaa bbb(ccc[ddd"eee'fff 'ggg -\> Aaa Bbb(Ccc[Ddd"Eee'fff 'Ggg**

See also ...  
[Großschreibung nach Hochkomma mit caps2?](https://community.mp3tag.de/t/4839/2)

DD.20120728.1314.CEST  
Edit.DD.20120729.0842.CEST

---

<div class="post-metadata">

### Author: ![stevehero](https://community.mp3tag.de/user_avatar/community.mp3tag.de/stevehero/32/337_2.png) [@stevehero](https://community.mp3tag.de/u/stevehero)
#### Post date: [July 28, 2012, 3:06pm UTC](https://community.mp3tag.de/t/regexp-help/13696/4 "2012-07-28T15:06:32Z")

</div>

> [@DetlevD](#):
>
> **$regexp($caps2(%FIELD%,' (["'),'\s\x27.','\U$0')**

**The same not be done with:**

Begin Action Group **\_Script Test#TEST**

**Action #1** _Actiontype 4:_ **Replace with regular expression** _Field \_\_\_\_\_\_\_\_\_\_\_\_\_\_:_ **\_TAG** _Regular expression \_:_ **(\B|^)(\(|\[|"|')(.)**_Replace matches with:_ **$1$2$upper($3)**[\_] Case sensitive comparison

End Action Group **\_Script Test#TEST** (1 Action)

**Resulting in:**

(the [torchum' "never 'stops blank(the[torchum"never'stops \>\>\>\> (The [Torchum' "Never 'Stops blank(the[torchum"never'stops

by breaking up the different parts like _not a word boundary OR start of string_ / (["'' / any one character to capture as $1, $2 & $3 (changed to upper-case) it seems to work. If you don't separate them like this you get unwanted results.

Plus one thing with using the action _'replace with regular expression'_ you can affect \_TAG (All tags) like the example above whereas with the format action you can't.

Anybody know why mp3tag doesn't pick up the start of the string '_**(t**_he [torchum' "never...' by using the \B. My fix was to put in a '|^' to fix the problem.

---

<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:23pm UTC](https://community.mp3tag.de/t/regexp-help/13696/5 "2026-02-09T12:23:58Z")

</div>


