# \[X\] Bug in RegExp parsing

**URL:** https://community.mp3tag.de/t/x-bug-in-regexp-parsing/15385
**Category:** No Bugs
**Created:** [January 11, 2014, 10:13pm UTC](https://community.mp3tag.de/t/x-bug-in-regexp-parsing/15385 "2014-01-11T22:13:18Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![chrishirst](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/c/4af34b/32.png) [@chrishirst](https://community.mp3tag.de/u/chrishirst)
#### Post date: [January 11, 2014, 10:13pm UTC](https://community.mp3tag.de/t/x-bug-in-regexp-parsing/15385/1 "2014-01-11T22:13:18Z")

</div>

Using a square bracket '[' or ']' as a literal gives an error

eg: trying to match ([\S]) (removing any non-whitespace in brackets) throws an error of:

> [@](#):
>
> "Unmatched marking parenthesis ( or (. The error occurred while parsing the regular expression: '()\>\>\>HERE\>\>\>'.""

Behaviour exists in v2.57 and v2.58

---

<div class="post-metadata">

### Author: ![dano](https://community.mp3tag.de/user_avatar/community.mp3tag.de/dano/32/6_2.png) [@dano](https://community.mp3tag.de/u/dano)
#### Post date: [January 12, 2014, 10:22am UTC](https://community.mp3tag.de/t/x-bug-in-regexp-parsing/15385/2 "2014-01-12T10:22:47Z")

</div>

[and] have a special function in the scripting language and must be also escaped inside the $regexp function with '['  
Or the easiest way is to put the whole term inside single quotes:  
'([\S])'

---

<div class="post-metadata">

### Author: ![chrishirst](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/c/4af34b/32.png) [@chrishirst](https://community.mp3tag.de/u/chrishirst)
#### Post date: [January 12, 2014, 3:13pm UTC](https://community.mp3tag.de/t/x-bug-in-regexp-parsing/15385/3 "2014-01-12T15:13:10Z")

</div>

> [@dano](#):
>
> [and] have a special function in the scripting language and must be also escaped

Yep I am aware of that, it was simply that all other RegExp enabled applications I use will accept [ as being a literal character of '[' rather than seeing it as a character class delimiter.

Notepad++ for example will use ([[\d]{4}]) to match [1968] [1999] [2012] etc. but the RegExp implementation in MP3tag will throw an error when using the same pattern.

---

<div class="post-metadata">

### Author: ![chrishirst](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/c/4af34b/32.png) [@chrishirst](https://community.mp3tag.de/u/chrishirst)
#### Post date: [January 14, 2014, 7:07pm UTC](https://community.mp3tag.de/t/x-bug-in-regexp-parsing/15385/4 "2014-01-14T19:07:04Z")

</div>

Okay figured out the array of single quotes required to remove brackets from tag text. 🙂

Therefore can I suggest an edit to the help/manual file.

The regexp syntax shows

> [@](#):
>
> **Literals**
> 
> All characters except . | \* ? + ( ) { } ^ $.  
> These characters are literals when preceded by a "".

So naturally I took it that ( or [ would suffice, this is not the case.

So the manual probably should be updated to show the correct syntax, which is '(' or '['to use the reserved characters as literals

---

<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: [January 14, 2014, 7:29pm UTC](https://community.mp3tag.de/t/x-bug-in-regexp-parsing/15385/5 "2014-01-14T19:29:46Z")

</div>

> [@Chris Hirst](#):
>
> ... So the manual probably should be updated to show the correct syntax, ...

'Chris Hirst', I can understand your confusion.  
Some clear statements in the documentation would help and it would be more obvious what is going on there, when someone uses the Mp3tag scripting language together with the Regular Expression language.  
See also ...  
[/t/11650/1](https://community.mp3tag.de/t/11650/1)

DD.20140114.2129.CET

---

<div class="post-metadata">

### Author: ![chrishirst](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/c/4af34b/32.png) [@chrishirst](https://community.mp3tag.de/u/chrishirst)
#### Post date: [January 14, 2014, 8:35pm UTC](https://community.mp3tag.de/t/x-bug-in-regexp-parsing/15385/6 "2014-01-14T20:35:15Z")

</div>

Oh bugger!!!

I wish I'd seen that thread earlier, it would have saved hours of playing about. 🙂

---

<div class="post-metadata">

### Author: ![chrishirst](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/c/4af34b/32.png) [@chrishirst](https://community.mp3tag.de/u/chrishirst)
#### Post date: [January 14, 2014, 8:37pm UTC](https://community.mp3tag.de/t/x-bug-in-regexp-parsing/15385/7 "2014-01-14T20:37:03Z")

</div>

Oh alright then; **Minutes** of playing around!!! 🙂

---

<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: [December 28, 2018, 2:33pm UTC](https://community.mp3tag.de/t/x-bug-in-regexp-parsing/15385/8 "2018-12-28T14:33:55Z")

</div>

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