0

Searching again - Using REGEX (Regular Expressions)

Searching is really odd in Ninox.

If I search for José I will get all records containing just José.
And if I search for Jose I will get all records containing just Jose.

But I should get all records containing the characters in the search term being them uppercase, lowercase or accented ones.

So Ninox should return all records containing, for example:
José
jósé
Josè
JOSÉ
josÉ
And so on ...

If the search is exactly for José I would enclose it in double quotes "José".

That is what I'm used to get with other Database engines and UTF-8 encoding.

It seems this does not work here.

As far as I can see the only workaround is to use Regular Expressions for searching.
Ninox manual does not tell much about this matter.
I do not know if they can be used, where and how:
- In the Global search box
- In the Table search box
- In the column heading Filter box
- In any script
- ...

I would appreciate any help on this subject with one or two examples to understand how they can be used in Ninox.

10replies Oldest first
  • Oldest first
  • Newest first
  • Active threads
  • Popular
    • Sean
    • Sean
    • 2 yrs ago
    • Reported - view

    Please search the Forum using replacex, extractx or testx as the search criteria.

    Like
  • Thank you for the advice.
    I did a search and there is a lot of information there.
    I will have to study them carefully. :)

    I don't know much about Javascrit.
    I do my programs in Python.
    REGEX in Javascript will not be that much different from Python.

    And luckily we have Ninox Console for testing.
    I already made a few suggestions to Birger to improve Console usability and I was told Ninox already is optimizing Console.
    So Good News. :)

    For those who are interested in REGEX I found a site (Online regex tester) where we can test REGEX expressions and learn a bit more about them.
    https://regex101.com

    Since I'm not a developer, I don't need to create bulletproof applications.
    Just for my own needs.
    However, I have a few tables with more than 40,000 records.

    Thanks for your help.

    Like
    • Sean
    • Sean
    • 2 yrs ago
    • Reported - view

    I don't know which regular expression module you are using in Python, but it could be very different with regard to features. You might want to look at this...

     

    https://www.rexegg.com/regex-python.html

     

    Also, flags don't work in the extractx() function right now.

    Like
  • I'm using the re module.

    Thanks for your help.

    Like
  • This function can help you ?

    function RemoveAccents(S : text) do
    S := replacex(S, “Ç”, “gi”, “C”);
    S := replacex(S, “ç”, “gi”, “c”);
    S := replacex(S, “è|é|ê|ë”, “gi”, “e”);
    S := replacex(S, “È|É|Ê|Ë”, “gi”, “E”);
    S := replacex(S, “à|á|â|ã|ä|å”, “gi”, “a”);
    S := replacex(S, “@|À|Á|Â|Ã|Ä|Å”, “gi”, “A”);
    S := replacex(S, “ì|í|î|ï”, “gi”, “i”);
    S := replacex(S, “Ì|Í|Î|Ï”, “gi”, “I”);
    S := replacex(S, “ð|ò|ó|ô|õ|ö”, “gi”, “o”);
    S := replacex(S, “Ò|Ó|Ô|Õ|Ö”, “gi”, “O”);
    S := replacex(S, “ù|ú|û|ü”, “gi”, “u”);
    S := replacex(S, “Ù|Ú|Û|Ü”, “gi”, “U”);
    S := replacex(S, “ý|ÿ”, “gi”, “y”);
    S := replacex(S, “Ý”, “gi”, “Y”);
    S
    end;

    Like
    • Sean
    • Sean
    • 1 yr ago
    • Reported - view

    Hello Jacques,

    If you want to preserve case, you need to remove the “i” flag. The “i” flag is used to ignore case. :)

    Like
  • Oops, indeed :O

    . Thanks :o)

    Like
    • Jacques TUR
    • Jacques_TUR
    • 1 yr ago
    • Official response
    • Reported - view

    Here is code with Sean“s fix.

    And this link give reference of JavaScript RegExp : https://www.w3schools.com/jsref/jsref_obj_regexp.asp

     

    function SansAccent(S : text) do
    S := replacex(S, ”Ç“, ”g“, ”C“);
    S := replacex(S, ”ç“, ”g“, ”c“);
    S := replacex(S, ”è|é|ê|ë“, ”g“, ”e“);
    S := replacex(S, ”È|É|Ê|Ë“, ”g“, ”E“);
    S := replacex(S, ”à|á|â|ã|ä|å“, ”g“, ”a“);
    S := replacex(S, ”@|À|Á|Â|Ã|Ä|Å“, ”g“, ”A“);
    S := replacex(S, ”ì|í|î|ï“, ”g“, ”i“);
    S := replacex(S, ”Ì|Í|Î|Ï“, ”g“, ”I“);
    S := replacex(S, ”ð|ò|ó|ô|õ|ö“, ”g“, ”o“);
    S := replacex(S, ”Ò|Ó|Ô|Õ|Ö“, ”g“, ”O“);
    S := replacex(S, ”ù|ú|û|ü“, ”g“, ”u“);
    S := replacex(S, ”Ù|Ú|Û|Ü“, ”g“, ”U“);
    S := replacex(S, ”ý|ÿ“, ”g“, ”y“);
    S := replacex(S, ”Ý“, ”g“, ”Y“);
    S
    end;

    Like
  • xx

    Like
  • Hello,

    I'm very sorry for the late reply.
    I have been really busy lately with some projects and have not had time to try the proposed solution.
    Thank you very much for your help Jacques and Sean.

    Like
Like Follow
  • 1 yr agoLast active
  • 10Replies
  • 1888Views