# How to filter tracks with unclosed Parenthesis "(Text ("

**URL:** <https://community.mp3tag.de/t/how-to-filter-tracks-with-unclosed-parenthesis-text/48096>\
**Category:** Support\
**Created:** [March 5, 2020, 11:35pm UTC](https://community.mp3tag.de/t/how-to-filter-tracks-with-unclosed-parenthesis-text/48096 "2020-03-05T23:35:39Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![SpirosG](https://community.mp3tag.de/user_avatar/community.mp3tag.de/spirosg/32/8589_2.png) [@SpirosG](https://community.mp3tag.de/u/SpirosG)\
**Post date:** [March 5, 2020, 11:35pm UTC](https://community.mp3tag.de/t/how-to-filter-tracks-with-unclosed-parenthesis-text/48096/1 "2020-03-05T23:35:39Z")

</div>

Hi, is it possible to create a filter to identify tracks with unclosed Parenthesis?  
ex. "(Text ("

Thanks!

---

<div class="post-metadata">

**Author:** ![ohrenkino](https://community.mp3tag.de/user_avatar/community.mp3tag.de/ohrenkino/32/4843_2.png) [@ohrenkino](https://community.mp3tag.de/u/ohrenkino)\
**Post date:** [March 6, 2020, 6:10am UTC](https://community.mp3tag.de/t/how-to-filter-tracks-with-unclosed-parenthesis-text/48096/2 "2020-03-06T06:10:32Z")

</div>

Try  
`%field% HAS "(" AND NOT %field% HAS ")"`

---

<div class="post-metadata">

**Author:** ![SpirosG](https://community.mp3tag.de/user_avatar/community.mp3tag.de/spirosg/32/8589_2.png) [@SpirosG](https://community.mp3tag.de/u/SpirosG)\
**Post date:** [March 6, 2020, 10:32am UTC](https://community.mp3tag.de/t/how-to-filter-tracks-with-unclosed-parenthesis-text/48096/3 "2020-03-06T10:32:04Z")

</div>

This is my fault... 😉

Actually what I want to filter is "(text (text)"

---

<div class="post-metadata">

**Author:** ![ohrenkino](https://community.mp3tag.de/user_avatar/community.mp3tag.de/ohrenkino/32/4843_2.png) [@ohrenkino](https://community.mp3tag.de/u/ohrenkino)\
**Post date:** [March 6, 2020, 10:41am UTC](https://community.mp3tag.de/t/how-to-filter-tracks-with-unclosed-parenthesis-text/48096/4 "2020-03-06T10:41:04Z")

</div>

Then try  
`title MATCHES "\(.*\(" AND NOT title MATCHES "\).*\)"`

---

<div class="post-metadata">

**Author:** ![SpirosG](https://community.mp3tag.de/user_avatar/community.mp3tag.de/spirosg/32/8589_2.png) [@SpirosG](https://community.mp3tag.de/u/SpirosG)\
**Post date:** [March 6, 2020, 12:38pm UTC](https://community.mp3tag.de/t/how-to-filter-tracks-with-unclosed-parenthesis-text/48096/5 "2020-03-06T12:38:41Z")

</div>

This works thank you @ohrenkino.

One more question is there any action which is able to identify and fix these tracks automatically?

I know i could use `REPLACE " (" with ") ("` if i filter these tracks first. **Actually this is WRONG** as the result would be `) (Text) (Text)` 😬

But what am asking is for an action which will be actually able to do that, Find and Replace at the same time.

`(Text (Text)` to `(Text) (Text)`

---

<div class="post-metadata">

**Author:** ![ohrenkino](https://community.mp3tag.de/user_avatar/community.mp3tag.de/ohrenkino/32/4843_2.png) [@ohrenkino](https://community.mp3tag.de/u/ohrenkino)\
**Post date:** [March 6, 2020, 3:39pm UTC](https://community.mp3tag.de/t/how-to-filter-tracks-with-unclosed-parenthesis-text/48096/6 "2020-03-06T15:39:04Z")

</div>

For a pattern where you assume that you always (if at all) miss the first closing bracket, you could run this Format value action:  
`$replace($regexp('(Text (Text)','(\(.*)( \(.*\))','$1)$2'),'))',')')`  
if all the brackets are there, you simply get the already existing string.

---

<div class="post-metadata">

**Author:** ![SpirosG](https://community.mp3tag.de/user_avatar/community.mp3tag.de/spirosg/32/8589_2.png) [@SpirosG](https://community.mp3tag.de/u/SpirosG)\
**Post date:** [March 6, 2020, 9:22pm UTC](https://community.mp3tag.de/t/how-to-filter-tracks-with-unclosed-parenthesis-text/48096/7 "2020-03-06T21:22:30Z")

</div>

"Text" was just an example i was trying to show the format of the tag.

So actually i am trying to find a way to fix these tags independently of the "Text" inside the brackets

---

<div class="post-metadata">

**Author:** ![ohrenkino](https://community.mp3tag.de/user_avatar/community.mp3tag.de/ohrenkino/32/4843_2.png) [@ohrenkino](https://community.mp3tag.de/u/ohrenkino)\
**Post date:** [March 6, 2020, 9:24pm UTC](https://community.mp3tag.de/t/how-to-filter-tracks-with-unclosed-parenthesis-text/48096/8 "2020-03-06T21:24:20Z")

</div>

I thought it was obvious that you replace the text constant with the field variable for the real expression.

---

<div class="post-metadata">

**Author:** ![SpirosG](https://community.mp3tag.de/user_avatar/community.mp3tag.de/spirosg/32/8589_2.png) [@SpirosG](https://community.mp3tag.de/u/SpirosG)\
**Post date:** [March 6, 2020, 9:46pm UTC](https://community.mp3tag.de/t/how-to-filter-tracks-with-unclosed-parenthesis-text/48096/9 "2020-03-06T21:46:06Z")

</div>

Sorry but my mind doesn't work right now 😅

So is there any way to do that independently of the text?

---

<div class="post-metadata">

**Author:** ![ohrenkino](https://community.mp3tag.de/user_avatar/community.mp3tag.de/ohrenkino/32/4843_2.png) [@ohrenkino](https://community.mp3tag.de/u/ohrenkino)\
**Post date:** [March 6, 2020, 9:49pm UTC](https://community.mp3tag.de/t/how-to-filter-tracks-with-unclosed-parenthesis-text/48096/10 "2020-03-06T21:49:32Z")

</div>

> [@ohrenkino](#):
>
> $replace($regexp('(Text (Text)','((._)( (._))','$1)$2'),'))',')')

could look like this:  
`$replace($regexp(%title%,'(\(.*)( \(.*\))','$1)$2'),'))',')')`

---

<div class="post-metadata">

**Author:** ![SpirosG](https://community.mp3tag.de/user_avatar/community.mp3tag.de/spirosg/32/8589_2.png) [@SpirosG](https://community.mp3tag.de/u/SpirosG)\
**Post date:** [March 6, 2020, 9:54pm UTC](https://community.mp3tag.de/t/how-to-filter-tracks-with-unclosed-parenthesis-text/48096/11 "2020-03-06T21:54:09Z")

</div>

Thank you once again @ohrenkino.

I tried something similar but it didn't work, as i said it's a tough time for me... 😅 😅 😅

Cheers mate!!!

---

<div class="post-metadata">

**Author:** ![SpirosG](https://community.mp3tag.de/user_avatar/community.mp3tag.de/spirosg/32/8589_2.png) [@SpirosG](https://community.mp3tag.de/u/SpirosG)\
**Post date:** [March 16, 2020, 10:22pm UTC](https://community.mp3tag.de/t/how-to-filter-tracks-with-unclosed-parenthesis-text/48096/12 "2020-03-16T22:22:42Z")

</div>

This filter will return tracks with Open parenthesis even if there are more parenthesis following  
ex. "(text (text) (text)" or "(text (text) (text) (text)"

`%Title% MATCHES "\(.*\(" AND %Title% MATCHES ".*?\(\w*?[^\)]*?\("`

Also these actions would fix the open brackets for the examples above

`Format value action:`

"(text (text) (text)" to "(text) (text) (text)"

`$replace($regexp(%title%,'(\(.*)( \(.*\))(.*\))','$1)$2$3'),'))',')')`

"(text (text) (text) (text)" to "(text) (text) (text) (text)"

`$replace($regexp(%title%,'(\(.*)( \(.*\))(.*\))(.*\))','$1)$2$3$4'),'))',')')`

---

<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:** [April 15, 2020, 10:22pm UTC](https://community.mp3tag.de/t/how-to-filter-tracks-with-unclosed-parenthesis-text/48096/13 "2020-04-15T22:22:45Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
