# Regular Expressions

**URL:** https://community.mp3tag.de/t/regular-expressions/521
**Category:** Howto
**Created:** [October 16, 2003, 4:47pm UTC](https://community.mp3tag.de/t/regular-expressions/521 "2003-10-16T16:47:29Z")
**Posts on this page:** 1
**Showing post:** 32

<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 31, 2010, 7:33am UTC](https://community.mp3tag.de/t/regular-expressions/521/32 "2010-08-31T07:33:02Z")

</div>

**Roman numerals in uppercase**

This "Regular Expression" changes Roman numerals in uppercase.  
Valid range of numbers: "I" to "MMMCMXCIX" (decimal: 1-3999).

Dieser "Reguläre Ausdruck" ändert römische Ziffern in Großbuchstaben.  
Gültiger Zahlenbereich: "I" bis "MMMCMXCIX" (dezimal: 1-3999).

Example  
From:  
"ab **i** ab **ii** ab **iii**  **iv**  **v** vv **vi**  **vii**  **viii**  **ix** abc **x**  **mcmliv**  **ll** cmm **mmix-ix-xi**"  
To:  
"ab **I** ab **II** ab **III**  **IV**  **V** vv **VI**  **VII**  **VIII**  **IX** abc **X**  **MCMLIV**  **ll** cmm **MMIX-IX-XI**"

```
$regexp(%TITLE%,'\b(?i:(?=[MDCLXVI])((M{0,3})((C[DM])|(D?C{0,3}))?((X[LC])|(L?X{0,3})|L)?((I[VX])|(V?(I{0,3}))|V)?))\b','\U$0')

```

Alternative:  
(using the 'ignore case' parameter of the Mp3tag $regexp function instead of regex modifier)

```
$regexp(%TITLE%,'\b(?=[MDCLXVI])((M{0,3})((C[DM])|(D?C{0,3}))?((X[LC])|(L?X{0,3})|L)?((I[VX])|(V?(I{0,3}))|V)?)\b','\U$0',1)

```

Attached is a Mp3tag mte export script, which visualizes the results of three attempts using regular epressions, which are able to upcase Roman Numerals in different quality.  
[Test.RomanNum.Upcase.zip](https://community.mp3tag.de/uploads/default/original/2X/6/6fde8ef02bcc14e22faf26f9799a112853e27f3c.zip) (1.95 KB)

DD.20100831.1133.CEST  
Edit. Spelling error in RegEx corrected and zip file attached.  
DD.20110320.1518.CET

[Test.RomanNum.Upcase.zip](https://community.mp3tag.de/uploads/default/original/2X/6/6fde8ef02bcc14e22faf26f9799a112853e27f3c.zip) (1.95 KB)

---

_[View the full topic](https://community.mp3tag.de/t/regular-expressions/521)._
