# RegExpr für klassiche Beschriftung von Tonart

**URL:** https://community.mp3tag.de/t/regexpr-fur-klassiche-beschriftung-von-tonart/6319
**Category:** Allgemein
**Created:** [February 23, 2008, 1:17pm UTC](https://community.mp3tag.de/t/regexpr-fur-klassiche-beschriftung-von-tonart/6319 "2008-02-23T13:17:45Z")
**Posts on this page:** 1
**Showing post:** 4

<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: [February 23, 2008, 2:54pm UTC](https://community.mp3tag.de/t/regexpr-fur-klassiche-beschriftung-von-tonart/6319/4 "2008-02-23T14:54:51Z")

</div>

Nur 'mal so als erster Versuch:

```
$caps($regexp($lower(%TONART%),^('['a-g']')\s(m(aj|in)or)$,$1-$2),-)

```

mit %TONART% = 'a miNor'  
ergibt es: 'A-Minor'

DD.20080223.1654.CET

... und ein zweiter Versuch:

```
$caps($regexp($replace($lower(%TONART%),'-flat ','b ','-sharp ','# '),^('['a-g']''['b#']'*)'['\s|-']'(m(aj|in)or)$,$1-$2),-)

```

oder

```
$caps($regexp($replace($lower(%TONART%),'-flat ','b ','-sharp ','# '),'^([a-g][b#]*)[\s|-](m(aj|in)or)$',$1-$2),-)

```

Beispiele:

'a-major' ==\> 'A-Major'  
'g-minor' ==\> 'G-Minor'

'a major' ==\> 'A-Major'  
'g minor' ==\> 'G-Minor'

'ab-minor' ==\> 'Ab-Minor'  
'a#-major' ==\> 'A#-Major'

'ab minor' ==\> 'Ab-Minor'  
'a# major' ==\> 'A#-Major'

'a-FLAT miNor' ==\> 'Ab-Minor'  
'a-ShArP mAJor' ==\> 'A#-Major'

DD.20080223.1711.CET

---

_[View the full topic](https://community.mp3tag.de/t/regexpr-fur-klassiche-beschriftung-von-tonart/6319)._
