
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.
-
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. -
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; -
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;