# Regexp help (HWV)

**URL:** <https://community.mp3tag.de/t/regexp-help-hwv/43108>\
**Category:** Support\
**Created:** [September 27, 2018, 5:42pm UTC](https://community.mp3tag.de/t/regexp-help-hwv/43108 "2018-09-27T17:42:37Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![chad](https://community.mp3tag.de/user_avatar/community.mp3tag.de/chad/32/5696_2.png) [@chad](https://community.mp3tag.de/u/chad)\
**Post date:** [September 27, 2018, 5:42pm UTC](https://community.mp3tag.de/t/regexp-help-hwv/43108/1 "2018-09-27T17:42:37Z")

</div>

Whenever I have filenames with the following format:  
Suite HWV 452 in Gm (I - Allemande)

I want to change it to:  
Suite in Gm, HWV 452 (I - Allemande)

I wrote the following regexp to do this, but it doesn't work (no match is produced), even despite [regexp101.com](http://regexp101.com) telling me that it DOES work:

Search for  
`HWV (\d+) in ([A-Ga-gm#]+)`  
Replace with:  
`in $2, HWV $1`

(Note: the A-Ga-gm# accounts for things like G#m, Bb, D, etc. - shorthand ways of writing musical keys)

I double-checked that it is indeed "Replace with regular expression," it's searching the correct field, and it is NOT case-sensitive.

Edit: I just tried the same code with a quick action (Actions --\> Actions (Quick)) and it worked. But when the code runs as part of a preset action, it doesn't work.

---

<div class="post-metadata">

**Author:** ![Florian](https://community.mp3tag.de/user_avatar/community.mp3tag.de/florian/32/5759_2.png) [@Florian](https://community.mp3tag.de/u/Florian)\
**Post date:** [September 27, 2018, 6:03pm UTC](https://community.mp3tag.de/t/regexp-help-hwv/43108/2 "2018-09-27T18:03:16Z")

</div>

Everything looks good from what you're describing.

Are there any other actions running before this one in the group that might alter the filename to a format that is not matching anymore? If not, can you please post a screenshot of the "Replace with regular expression" dialog.

---

<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:27pm UTC](https://community.mp3tag.de/t/regexp-help-hwv/43108/3 "2026-02-09T12:27:41Z")

</div>


