[X] Bug in RegExp parsing

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:

Behaviour exists in v2.57 and v2.58

[ 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:

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.

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

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

The regexp syntax shows

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

'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 ...


Oh bugger!!!

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

Oh alright then; Minutes of playing around!!! :slight_smile:

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