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.
11 replies
-
Please search the Forum using replacex, extractx or testx as the search criteria.
-
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.comSince 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.
-
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. -
I'm using the re module.
Thanks for your help.
-
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; -
Hello Jacques,
If you want to preserve case, you need to remove the “i” flag. The “i” flag is used to ignore case. :)
-
Oops, indeed :O
. Thanks :o)
-
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;
-
xx
-
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. -
Hello, I have a similar issue using the search bar...
In our customer table, we can never find a Turkish customer because their name contains this character: "İ"
When we write the name into the search bar, the search return no result!!!
Even if we copied the name EXACTLY as it appears in our records in that same table.
Is there some way to fix it?
I would be happy to use regular expressions in the search bar, but I don't know what I have to modify the behaviour in the search bar.
Content aside
- 1 yr agoLast active
- 11Replies
- 2094Views
-
1
Following