# (\[^\\-\]\*) is not working

**URL:** <https://community.mp3tag.de/t/is-not-working/18750>\
**Category:** Support\
**Created:** [February 24, 2017, 6:46pm UTC](https://community.mp3tag.de/t/is-not-working/18750 "2017-02-24T18:46:36Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![peymanch](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/p/65b543/32.png) [@peymanch](https://community.mp3tag.de/u/peymanch)\
**Post date:** [February 24, 2017, 6:46pm UTC](https://community.mp3tag.de/t/is-not-working/18750/1 "2017-02-24T18:46:36Z")

</div>

**hi  
why [^] is not working in $regexp in this program?  
i want match any character is not "-" but this code is not working!  
please help me**

---

<div class="post-metadata">

**Author:** ![stevehero](https://community.mp3tag.de/user_avatar/community.mp3tag.de/stevehero/32/337_2.png) [@stevehero](https://community.mp3tag.de/u/stevehero)\
**Post date:** [February 24, 2017, 8:35pm UTC](https://community.mp3tag.de/t/is-not-working/18750/2 "2017-02-24T20:35:51Z")

</div>

Try without \

```
([^-]*)

```

Reason - doesn't need to be escaped like you've shown it.

---

<div class="post-metadata">

**Author:** ![stevehero](https://community.mp3tag.de/user_avatar/community.mp3tag.de/stevehero/32/337_2.png) [@stevehero](https://community.mp3tag.de/u/stevehero)\
**Post date:** [February 24, 2017, 8:48pm UTC](https://community.mp3tag.de/t/is-not-working/18750/3 "2017-02-24T20:48:43Z")

</div>

You can use a positive lookahead to get the same result.

This will remove EVERYTHING for the string except -

 

Use on your files with caution.

**Field:** TITLE  
**Format string:** $regexp(%title%,'(?=[^-]).',)

You're right regarding the initial problem. That doesn't work.

Not sure why you want to remove all but a hyphen.

Can you give an example of what you want to achieve?

---

<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:26pm UTC](https://community.mp3tag.de/t/is-not-working/18750/4 "2026-02-09T12:26:42Z")

</div>


