# Troubleshooting an Existing Regex

**URL:** <https://community.mp3tag.de/t/troubleshooting-an-existing-regex/61263>\
**Category:** Support\
**Created:** [June 14, 2023, 10:29am UTC](https://community.mp3tag.de/t/troubleshooting-an-existing-regex/61263 "2023-06-14T10:29:30Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![LyricsLover](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/l/c6cbf5/32.png) [@LyricsLover](https://community.mp3tag.de/u/LyricsLover)\
**Post date:** [June 14, 2023, 1:03pm UTC](https://community.mp3tag.de/t/troubleshooting-an-existing-regex/61263/4 "2023-06-14T13:03:30Z")

</div>

> [@ragtag](#):
>
> received this error message in the Artist field

You are right, sorry for the confusion.  
For a Mp3tag regular expression you have to escape the minus dash (after `\w`) with a backslash, otherwise the minus will be interpreted in a unwanted way.  
Please try it with this format string:  
`$regexp(%ARTIST%,'^.*\s([\w\-‐]+)$','$1')`  
 ![image](https://community.mp3tag.de/uploads/default/original/2X/2/2b090013bff23941cd198ea279271a8e63dc8bdb.png)

> [@ragtag](#):
>
> If at all possible, is it not feasible to construct an expression that combines the most commonly used hyphens, since these are not easy to tell apart?

Unfortunately, I'm not aware that an easy way exists for this. You would have to enter all the various dash variants in your regular expression.

---

_[View the full topic](https://community.mp3tag.de/t/troubleshooting-an-existing-regex/61263)._
