0

can we use a regex to filter a column ?

hi all, i think the title above says it all… i'd like to filter a column using a regular expression… is that possible ? how would i enter the regex ?

thanks for your answers

laurent

9 replies

null
    • Mconneen
    • 4 yrs ago
    • Reported - view

    @Laurent, 

    Yes.. you can... See https://ninoxdb.de/en/manual/calculations/reference-of-functions-and-language .. then page search / find "regular expression"

    • Laurent
    • 4 yrs ago
    • Reported - view

    thanks mconneen, i'll try to filter a column by some regex easier to enter than [ !="hotmail.co.uk" and !="hotmail.com" and !="hotmail.de" and !="hotmail.es" and !="hotmail.fr" and !="live.co.uk" and !="live.com" and !="live.fr" and !="live.nl" and !="outlook.com" and !="outlook.fr" and !="msn.com" ] ; to select mail addresses that aren't from the above… under DOS would have been so easy to enter !=hotmail.* for exemple…

    • Laurent
    • 4 yrs ago
    • Reported - view

    i'm trying to get better at regex…

    • Sean
    • 4 yrs ago
    • Reported - view

    Hmm, I'm thinking no. I've been playing around with the regex functions and I think that's the only way you can use regex in Ninox. That means in order for Ninox to interpret the regex condition for what it is it will have to be in one of the following functions...

     

    testx(), replacex(), extractx()

     

    I tried using the testx() function in a column filter and I couldn't get it to work. It will work to filter the records in a View layout element. Something like this...

     

    select YourTable where testx(YourField, "YourRegex")

     

    For what it's worth, according to https://www.rexegg.com/regex-javascript.html the regex engine in JavaScript is not good and that is what Ninox is tied to.

    • Laurent
    • 4 yrs ago
    • Reported - view

    thanks sean, i think you're correct, i can't do what i wanted to do… i guess that sometimes it's faster to do things with a little typing than to try to figure out a way to do it using some clever coding… anyway i'd love to be able to input regex in those filtering cell we have on the top of the columns !! (if someone at Ninox can hear me… thanks !)

    • Mconneen
    • 4 yrs ago
    • Reported - view

    DISCLAIMER .. I am barely a regex novice.... usually pretty good at "copy / paste" and reuse in a shell script or something.. :)   

    If I add a formula to check to see if an email ends in .com using 

    regex_script

    I can filter a table view by Yes / No.. 

    regex

    So..I guess I could look for all the patterns you mention above.. something like.. 

    regexOR

    • Allegra Marketing
    • Patel
    • 4 yrs ago
    • Reported - view

    Yes you can use regular expressions on column filters but you don't need to in this instance.

    • Laurent
    • 4 yrs ago
    • Reported - view

    @mconneen

    thanks for the concern, i know you're a king… Master(864)…

    on your example, wouldn't it better to type "(^.+\.com$|^.+\.co\.uk$)" with + and not * and one more \ before .uk ?

    what i wanted to do was to simply enter the regex here (hope my screenshot is ok, it appears shrinked to me ? => if you know why, please tell me…) :

    screen 2019-10-23 à 09.04.01

    for example we could have "" to tell Ninox that the following is a regex… (or another sign…)

     

    @patel

    hi, please take a look at the screenshot above (if it is not too shrinked ?) => that was what i wanted to do…

     

    thanks all, it's great to have answers like yours

    see you soon on this great forum !

    • Mconneen
    • 4 yrs ago
    • Reported - view

    @Laurent .. I am a regex novice.. :)   As for "Master".. well..the Ninox forum count appears to subscribe to the Socratic Method .. :)   Meaning .. it simply counts how many posts you have.. They "could" be all questions and / or "wrong" answers.. LOL. .

    So far.. the apporach that works best is to create a formula field with the regex .. and then filter.. :( 

Content aside

  • 4 yrs agoLast active
  • 9Replies
  • 2403Views