• Telorand@reddthat.com
    link
    fedilink
    arrow-up
    0
    ·
    edit-2
    8 months ago

    Because there’s non-programmers in this community, if you aren’t sure what this means but are too afraid to ask, it’s a Regular Expression that better represents the terms “Linux” and “Unix.”

    Though if we’re going to be that pedantic, it would be [nN][uiI][xX]$. That extra pipe wouldn’t actually do anything in the last example, because regexp picks one character from the set by default.

    And if we want to be really pedantic,

    (?!nix)[nN][uI][xX]$
    

    Would be the most accurate.

    Edit: based on comments, I think…

    (nux|NIX)$
    

    …would be the best. Then you don’t wind up with weird matches with things like UNiX.

    • jyoskykid@sh.itjust.works
      link
      fedilink
      arrow-up
      0
      arrow-down
      1
      ·
      edit-2
      8 months ago

      All that effort, when you could’ve just called it LUNIX.

      By the way, does this expression match LUNIX? But if so, won’t it also match Binux or Bunix?