Case insensitive filter rule

Support requests, bug reports, etc. go here. Dedicated servers / VDS hosting only
gujdoa
Bear Rating Trainee
Bear Rating Trainee
Posts: 10
Joined: 24 Jul 2014, 03:44

Case insensitive filter rule

Postby gujdoa » 24 Jul 2014, 03:48

I know the current filters are case sensitive, but I wonder if there's any trick to make them sensitive, or can we have the option to make them case sensitive in a future version?

mrc0mmand
Bear Rating Trainee
Bear Rating Trainee
Posts: 16
Joined: 06 Feb 2014, 21:49

Re: Case insensitive filter rule

Postby mrc0mmand » 24 Jul 2014, 04:42

Maybe you look for something like this:

Code: Select all

(?i)abc               case-insensitive match of abc, ABC, aBc, ABc, etc.


Nvm

gujdoa
Bear Rating Trainee
Bear Rating Trainee
Posts: 10
Joined: 24 Jul 2014, 03:44

Re: Case insensitive filter rule

Postby gujdoa » 24 Jul 2014, 12:38

From the linked PHP reference, to match at least five uppercase characters, I've tried:

Code: Select all

[A-Z]{5,}

Code: Select all

(?-i)[A-Z]{5,}

and

Code: Select all

(?-i:[A-Z]{5,})


None of which seem to work.

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

Re: Case insensitive filter rule

Postby fox » 24 Jul 2014, 13:04

Filters are case-insensitive. Try reading the page you linked.

gujdoa
Bear Rating Trainee
Bear Rating Trainee
Posts: 10
Joined: 24 Jul 2014, 03:44

Re: Case insensitive filter rule

Postby gujdoa » 24 Jul 2014, 13:18

"I know the current filters are case sensitive" (try reading the first post!). I was asking if there's any "trick", ie. hack, undocumented, that would bypass the forced sensitivity, and if there isn't, could we have the ability in future?

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

Re: Case insensitive filter rule

Postby fox » 24 Jul 2014, 13:38

Are you developmentally disabled? Serious question.

User avatar
swa
Bear Rating Trainee
Bear Rating Trainee
Posts: 6
Joined: 27 May 2013, 23:16

Re: Case insensitive filter rule

Postby swa » 24 Jul 2014, 13:49

fox wrote:Are you developmentally disabled? Serious question.

I think you should make them case-sensitive and then write a hack for this gentleman. (Read the first post!!)

AngryChris
Bear Rating Master
Bear Rating Master
Posts: 135
Joined: 08 Apr 2013, 02:42

Re: Case insensitive filter rule

Postby AngryChris » 24 Jul 2014, 14:21

gujdoa wrote:"I know the current filters are case sensitive" (try reading the first post!). I was asking if there's any "trick", ie. hack, undocumented, that would bypass the forced sensitivity, and if there isn't, could we have the ability in future?

The link you posted wrote:Filters
Filters are a very powerful and flexible tool which may significantly ease the task of extracting useful information from the sea of data that is RSS feeds. Filters are applied to articles based on regular expression match against specified fields. After the match had been found, configured actions are taken. Matching is case-insensitive, PCRE pattern syntax is used.

You have the ability right now.

gujdoa
Bear Rating Trainee
Bear Rating Trainee
Posts: 10
Joined: 24 Jul 2014, 03:44

Re: Case insensitive filter rule

Postby gujdoa » 24 Jul 2014, 14:30

God damn, my mistake. I typoed in the first post. I know they're case INsensitive. I'd like to know if there's a workaround to make them case sensitive.

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

Re: Case insensitive filter rule

Postby fox » 24 Jul 2014, 14:31

Poster of the week right there.

gujdoa
Bear Rating Trainee
Bear Rating Trainee
Posts: 10
Joined: 24 Jul 2014, 03:44

Re: Case insensitive filter rule

Postby gujdoa » 24 Jul 2014, 14:32

And the answer is…?

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

Re: Case insensitive filter rule

Postby fox » 24 Jul 2014, 15:12

Try reading the first post!

gujdoa
Bear Rating Trainee
Bear Rating Trainee
Posts: 10
Joined: 24 Jul 2014, 03:44

Re: Case insensitive filter rule

Postby gujdoa » 02 Aug 2014, 20:00

Code: Select all

diff -u include.orig/functions2.php include/functions2.php
--- include.orig/functions2.php   2014-08-02 16:49:51.000000000 +0100
+++ include/functions2.php   2014-08-02 16:51:28.000000000 +0100
@@ -2098,8 +2098,8 @@
 
                switch ($rule["type"]) {
                case "title":
-                  $qpart = "LOWER(ttrss_entries.title) $reg_qpart LOWER('".
-                     $rule['reg_exp'] . "')";
+                  $qpart = "ttrss_entries.title $reg_qpart '".
+                     $rule['reg_exp'] . "'";
                   break;
                case "content":
                   $qpart = "LOWER(ttrss_entries.content) $reg_qpart LOWER('".
diff -u include.orig/rssfuncs.php include/rssfuncs.php
--- include.orig/rssfuncs.php   2014-08-02 16:49:58.000000000 +0100
+++ include/rssfuncs.php   2014-08-02 16:51:28.000000000 +0100
@@ -1287,7 +1287,7 @@
 
             switch ($rule["type"]) {
             case "title":
-               $match = @preg_match("/$reg_exp/i", $title);
+               $match = @preg_match("/$reg_exp/", $title);
                break;
             case "content":
                // we don't need to deal with multiline regexps


I was only concerned with matching in the title.


Return to “Support”

Who is online

Users browsing this forum: Google [Bot] and 5 guests