Is Regex supported in the group-settings?

Ask for help and report issues with the Mac OS X version of Transmission
Post Reply
Bootliner
Posts: 8
Joined: Sun Feb 22, 2009 4:07 pm

Is Regex supported in the group-settings?

Post by Bootliner »

I see that the different alternatives for lets say "name" under the grouping options are "contains" "is", "is not" "matches" etc. Does "matches" means support for Regex, as it does in the app Automatic (which btw is a great app for subscribing and autodownloading torrents from RSS-feeds: http://codingcurious.com/automatic/) Considering how alike the GUIs are for these two, I would guess that "matches" means regex, but i'm not sure, and couldn't find it in the documentation or here in the forum.
Bootliner
Posts: 8
Joined: Sun Feb 22, 2009 4:07 pm

Re: Is Regex supported in the group-settings?

Post by Bootliner »

No-one can answer this? What is the difference then between "matches" and "contains" ?
skygazer
Posts: 1
Joined: Mon Jan 28, 2013 2:58 am

Re: Is Regex supported in the group-settings?

Post by skygazer »

Yes, Regex appears to be supported in the group settings. The code uses the NSPredicateEditor, which supports RegEx in the matches field. The "MATCHES" operator is referenced at https://developer.apple.com/library/mac ... Using.html where it states that the the ICU RegEx package http://userguide.icu-project.org/strings/regexp is used to resolve regular expressions.

One caveat is that it's not looking for a partial match — the regex has to match the entire line. So it's best to use ".*" before and after an attempted partial search. For instance, to find strings that would match both "filename S01E01.m4v" and "filename S02E12.m4v" you'd want to use ".*S\d\dE\d\d.* " or some variation.

I know this is years late, but I had the same question earlier tonight, and saw that the question has been asked here repeatedly with, surprisingly, no answer. So I looked at the source, did some googling, and here I am.
guigarfr
Posts: 2
Joined: Sun Apr 20, 2014 8:18 pm

Re: Is Regex supported in the group-settings?

Post by guigarfr »

For example, add a "matches" condition like this to your tv shows: .*S[0-9]{2}E[0-9]{2}.*


and then another one for the name
Post Reply