Page 1 of 1

Case insensitive filter rule

Posted: 24 Jul 2014, 03:48
by gujdoa
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?

Re: Case insensitive filter rule

Posted: 24 Jul 2014, 04:42
by mrc0mmand
Maybe you look for something like this:

Code: Select all

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


Nvm

Re: Case insensitive filter rule

Posted: 24 Jul 2014, 12:38
by gujdoa
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.

Re: Case insensitive filter rule

Posted: 24 Jul 2014, 13:04
by fox
Filters are case-insensitive. Try reading the page you linked.

Re: Case insensitive filter rule

Posted: 24 Jul 2014, 13:18
by gujdoa
"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?

Re: Case insensitive filter rule

Posted: 24 Jul 2014, 13:38
by fox
Are you developmentally disabled? Serious question.

Re: Case insensitive filter rule

Posted: 24 Jul 2014, 13:49
by swa
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!!)

Re: Case insensitive filter rule

Posted: 24 Jul 2014, 14:21
by AngryChris
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.

Re: Case insensitive filter rule

Posted: 24 Jul 2014, 14:30
by gujdoa
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.

Re: Case insensitive filter rule

Posted: 24 Jul 2014, 14:31
by fox
Poster of the week right there.

Re: Case insensitive filter rule

Posted: 24 Jul 2014, 14:32
by gujdoa
And the answer is…?

Re: Case insensitive filter rule

Posted: 24 Jul 2014, 15:12
by fox
Try reading the first post!

Re: Case insensitive filter rule

Posted: 02 Aug 2014, 20:00
by gujdoa

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.