Using complex regexp in the new inlcude file

@Florian, this is the contents of my Beatport by &stevehero v5.0#RELEASE Search by Relea&Se.src file.

[SearchBy]=Album search|$trim($regexp($regexp($regexp(%album%,\b-\b|_,' '),(?i)\[.*\]|cd\s*\d*|[^\s]|\bep\b|feat\.|ft\.|\bom\b|\boriginal\b|\bclub\b|\bmix\b|\bremix\b|\bthe\b|vinyl|web|www[^\s]+|[^\w\s]|\b&*amp,),\s+,' '))|%s
[Include]=Beatport by &stevehero v5.0#Release

It's returning an error even though that's a valid function:

I'm trying to use this in its basic form: Field Name|%field%|&query=%s.

It's the naïve implementation that can't handle such complex expressions that have multiple | characters that should not be treated as separator (as in your regular expressions).

The implementation currently assumes that there is no | in any of the triplets and that the pipe characters is solely used as separator of those.

So, is this something that will be added in the future?

I do like the include function but could you reconsider my idea as an alternative to put these line(s) inside the .scr files themselves which will do the same thing and also limit the number of files. Instead of my beatport scripts having 18 files, I'll only have 4.

Link to that idea: WSS Options: Choose which tag to search

I'll change the delimiter to be || with the next version. So far, only the official Discogs tag sources are affected and using two of the pipe symbols probably doesn't break with the complex regular expressions you're using. If you have any objections please let me know.

Regarding your other idea, I can see the value from the point of creating the tag sources. However, it would make the implementation even more complex and would mean a lot of work. Because I can't see a real benefit for the user — other than needing to copy fewer files — I'm putting that off for now.

1 Like

None at all, if it allows the or expression | in the include file for regex fn then that will be great.

Thanks for this Florian.

OK about the other, I just thought it was a nice idea to get the file cluter down in my sources folder and to limit the slightly unnecessary extra files :slight_smile:

I've changed the implementation to use two pipe symbols || as SearchBy delimiter for tag sources with Mp3tag v2.99b.

1 Like