Regular Expressions for Filters

Support requests, bug reports, etc. go here. Dedicated servers / VDS hosting only
wreckedred
Bear Rating Trainee
Bear Rating Trainee
Posts: 6
Joined: 17 Mar 2013, 18:54

Regular Expressions for Filters

Postby wreckedred » 09 Mar 2014, 08:08

I am trying to create a filter based on a regular expression.
In my filter if I use S01E05 I get matches but if I use S(\d+)E05 I don't and
I don't get matches on S(\d*)E05 or /S(\d*)E05/

Is there a guide I could look at or some examples somewhere?

Thanks

tob
Bear Rating Trainee
Bear Rating Trainee
Posts: 30
Joined: 08 Feb 2014, 20:35

Re: Regular Expressions for Filters

Postby tob » 10 Mar 2014, 05:12

Looks like it's all done via

Code: Select all

preg_match("/$reg_exp/i")
so see http://php.net/manual/en/book.pcre.php

Be aware that filters operate on the raw content, which may contain whitespace or tags you don't see in the rendered HTML.

wreckedred
Bear Rating Trainee
Bear Rating Trainee
Posts: 6
Joined: 17 Mar 2013, 18:54

Re: Regular Expressions for Filters

Postby wreckedred » 13 Mar 2014, 05:56

To create a filter that matches the first episodes of any season is S..E01

tob
Bear Rating Trainee
Bear Rating Trainee
Posts: 30
Joined: 08 Feb 2014, 20:35

Re: Regular Expressions for Filters

Postby tob » 13 Mar 2014, 11:18

Did you try \\d escaping as used in the manual?

wreckedred
Bear Rating Trainee
Bear Rating Trainee
Posts: 6
Joined: 17 Mar 2013, 18:54

Re: Regular Expressions for Filters

Postby wreckedred » 13 Mar 2014, 22:55

I didn't see that ...can you point me exactly where you mean?

There is little information in the wiki regarding filters and no examples. A search of the site with keywords "Filters Regular Expressions" returns one entry...the wiki
Last edited by wreckedred on 13 Mar 2014, 23:28, edited 1 time in total.

User avatar
fox
^ me reading your posts ^
Posts: 6318
Joined: 27 Aug 2005, 22:53
Location: Saint-Petersburg, Russia
Contact:

Re: Regular Expressions for Filters

Postby fox » 13 Mar 2014, 23:22

PCRE is not something specific to tt-rss you know.

SkyRE
Bear Rating Trainee
Bear Rating Trainee
Posts: 5
Joined: 01 Sep 2013, 13:27

Re: Regular Expressions for Filters

Postby SkyRE » 17 Mar 2014, 13:33

wreckedred
Use S[0-9][0-9]E[0-9][0-9].


Return to “Support”

Who is online

Users browsing this forum: No registered users and 14 guests