# Capitalize album references?

**URL:** https://community.mp3tag.de/t/capitalize-album-references/11927
**Category:** General Discussion
**Created:** [April 27, 2011, 8:48pm UTC](https://community.mp3tag.de/t/capitalize-album-references/11927 "2011-04-27T20:48:07Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![Harakiri](https://community.mp3tag.de/user_avatar/community.mp3tag.de/harakiri/32/142_2.png) [@Harakiri](https://community.mp3tag.de/u/Harakiri)
#### Post date: [April 27, 2011, 8:48pm UTC](https://community.mp3tag.de/t/capitalize-album-references/11927/1 "2011-04-27T20:48:07Z")

</div>

Good evening fellow members!

I've been noticing another pattern regarding album references, they all contain numbers in between (e.g.: Huma8028, Iconia (Hbt026), (Freakmp3006), Ashadow25cd, Ep-Fprdigi029-Web).

I want to create a Regex action that obeys the following conditions:

If a word contains numbers regardless of their position, UPPER CASE it. Can anyone help? 🙂

Thanks!

---

<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: [April 28, 2011, 2:18am UTC](https://community.mp3tag.de/t/capitalize-album-references/11927/2 "2011-04-28T02:18:30Z")

</div>

> [@Harakiri](#):
>
> Good evening fellow members!  
> I've been noticing another pattern regarding album references, they all contain numbers in between (e.g.: Huma8028, Iconia (Hbt026), (Freakmp3006), Ashadow25cd, Ep-Fprdigi029-Web).  
> I want to create a Regex action that obeys the following conditions:  
> If a word contains numbers regardless of their position, UPPER CASE it. Can anyone help? 🙂 Thanks!

'Harakiri' you are a member of the forum from the same days when I came into the forum too, about 5 years ago.  
In the meantime you have asked all kinds of questions.  
Yesterday you got a big help again - which should help now for this newly request too - with small modification of the given regex arguments, hmm, I hope so.  
You should be able to find the similar solution for yourself.

> [@Harakiri](#):
>
> I want to create a Regex action that obeys the following conditions:

So if you want to create, then do create.  
If you are able to describe the rules, you are able to apply the rules.  
Test your result, and if it errors out, then present your scripting expression here and someone may be willing to help you out of the calamities.  
Thinking and experimentation is mostly your part.

DD.20110428.0630.CEST

---

<div class="post-metadata">

### Author: ![Harakiri](https://community.mp3tag.de/user_avatar/community.mp3tag.de/harakiri/32/142_2.png) [@Harakiri](https://community.mp3tag.de/u/Harakiri)
#### Post date: [April 28, 2011, 3:10am UTC](https://community.mp3tag.de/t/capitalize-album-references/11927/3 "2011-04-28T03:10:36Z")

</div>

I believe i suffer from ADD or something alike, i was never good at math and regex'es get confusing in my head. At the same time i ask for help i try to experiment with what i already have. I do understand your point and i apologize the inconvenience.

---

<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: [April 28, 2011, 4:58am UTC](https://community.mp3tag.de/t/capitalize-album-references/11927/4 "2011-04-28T04:58:13Z")

</div>

> [@Harakiri](#):
>
> ... (e.g.: Huma8028, Iconia (Hbt026), (Freakmp3006), Ashadow25cd, Ep-Fprdigi029-Web). ...

Could you be more specific, what characters of your example string should be uppercased?  
Is it always such a long string with many cases at once?  
Or is each substring element available separately in one tag-field?  
How is this tag-field named?

DD.20110428.0917.CEST

---

<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: [April 28, 2011, 6:06am UTC](https://community.mp3tag.de/t/capitalize-album-references/11927/5 "2011-04-28T06:06:01Z")

</div>

If you want only the letters to be in upper case then simply appy a filter that shows (in whatever field you have that data) tracks with numbers in it.  
Then create a user-defined action to modify the upper/lower case and set the option to "CAPITALS" as numbers don't "capitalize", they stay the same.  
The filter could look like  
%whateverfield% MATCHES "._\d_.\*"

---

<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: [April 28, 2011, 6:30am UTC](https://community.mp3tag.de/t/capitalize-album-references/11927/6 "2011-04-28T06:30:52Z")

</div>

> [@Harakiri](#):
>
> ... album references, they all contain numbers in between (e.g.: Huma8028, Iconia (Hbt026), (Freakmp3006), Ashadow25cd, Ep-Fprdigi029-Web) ... a Regex action ... If a word contains numbers regardless of their position, UPPER CASE it. ...

I've searched the Internet and found something interesting, which might work for this case.  
See following scripting expressions, which utilize the Mp3tag function $regexp.

**$regexp('Huma8028, Iconia (Hbt026), (Freakmp3006), Test, 4711-EdC, Ashadow25cd, Ep-Fprdigi029-Web','\b([[:alpha:]]+[[:digit:]]+[[:alnum:]]\*|[[:digit:]]+[[:alpha:]]+[[:alnum:]]\***

**)\b','\U$1')**  
From:  
Huma8028, Iconia (Hbt026), (Freakmp3006), Test, 4711-EdC, Ashadow25cd, Ep-Fprdigi029-Web  
To:  
HUMA8028, Iconia (HBT026), (FREAKMP3006), Test, 4711-EdC, ASHADOW25CD, Ep-FPRDIGI029-Web

 **$regexp('Huma8028, Iconia (Hbt026), (Freakmp3006), Test, 4711-EdC, Ashadow25cd, Ep-Fprdigi029-Web','\b([-[:alpha:]]+[[:digit:]]+[[:alnum:]-]\*|[-[:digit:]]+[[:alpha:]]+[[:alnum:]-]\*)\b','\U$1')** 

From:  
Huma8028, Iconia (Hbt026), (Freakmp3006), Test, 4711-EdC, Ashadow25cd, Ep-Fprdigi029-Web  
To:  
HUMA8028, Iconia (HBT026), (FREAKMP3006), Test, 4711-EDC, ASHADOW25CD, EP-FPRDIGI029-WEB

 

DD.20110428.1033.CEST

---

<div class="post-metadata">

### Author: ![Harakiri](https://community.mp3tag.de/user_avatar/community.mp3tag.de/harakiri/32/142_2.png) [@Harakiri](https://community.mp3tag.de/u/Harakiri)
#### Post date: [April 28, 2011, 6:39am UTC](https://community.mp3tag.de/t/capitalize-album-references/11927/7 "2011-04-28T06:39:52Z")

</div>

Forgive me lord for i have sinned! I actually found a solution in other site: [http://gskinner.com/RegExr/](http://gskinner.com/RegExr/).

Therefore i could create several Regex'es based on this one:

[a-z0-9][a-z]+[0-9]+

Matches any word followed by numbers.

I created several derivatives from this one:

\S+[A-z0-9][0-9]+[a-z]+[\w'-]+[A-Z]

[A-z0-9][a-z]+[0-9]+[a-z]

[A-z0-9][a-z]+[0-9]+[a-z]{1,}

[A-z0-9]+[0-9]{1,}

I couldn't manage to create a single Regex that could handle all the album references so i worked around my problem. I would be glad to hear if someone could convert this array of expressions into a single one! 🙂

---

<div class="post-metadata">

### Author: ![Harakiri](https://community.mp3tag.de/user_avatar/community.mp3tag.de/harakiri/32/142_2.png) [@Harakiri](https://community.mp3tag.de/u/Harakiri)
#### Post date: [April 28, 2011, 7:08am UTC](https://community.mp3tag.de/t/capitalize-album-references/11927/8 "2011-04-28T07:08:46Z")

</div>

> [@DetlevD](#):
>
> I've searched the Internet and found something interesting, which might work for this case.  
> See following scripting expressions, which utilize the Mp3tag function $regexp.
> 
> **$regexp('Huma8028, Iconia (Hbt026), (Freakmp3006), Test, Ashadow25cd, Ep-Fprdigi029-Web','\b([[:alpha:]]+[[:digit:]]+[[:alnum:]]\*|[[:digit:]]+[[:alpha:]]+[[:alnum:]]\***
> 
> **)\b','\U$1')**  
> From:  
> Huma8028, Iconia (Hbt026), (Freakmp3006), Test, 4711-EdC, Ashadow25cd, Ep-Fprdigi029-Web  
> To:  
> HUMA8028, Iconia (HBT026), (FREAKMP3006), Test, 4711-EdC, ASHADOW25CD, Ep-FPRDIGI029-Web
> 
> **$regexp('Huma8028, Iconia (Hbt026), (Freakmp3006), Test, Ashadow25cd, Ep-Fprdigi029-Web','\b([-[:alpha:]]+[[:digit:]]+[[:alnum:]-]\*|[-[:digit:]]+[[:alpha:]]+[[:alnum:]-]\*)\b','\U$1')** 
> 
> From:  
> Huma8028, Iconia (Hbt026), (Freakmp3006), Test, 4711-EdC, Ashadow25cd, Ep-Fprdigi029-Web  
> To:  
> HUMA8028, Iconia (HBT026), (FREAKMP3006), Test, 4711-EDC, ASHADOW25CD, EP-FPRDIGI029-WEB
> 
>  
> 
> DD.20110428.1033.CEST

After testing your beautiful regexes i kinda feel like a redneck. This works wonders, many thanks! 🙂
