Account in picture was banned within minutes of posting this information

  • PaX [comrade/them, they/them]@hexbear.net
    link
    fedilink
    English
    arrow-up
    12
    ·
    edit-2
    2 months ago

    A program that separates these out of that config file/representation/whatever this is (idk what Okta is tbh) into individual substrings is really easy

    I actually wrote a regex that matches each username in that structure for fun lol: (?<=[\[| ])[a-zA-Z0-9_]+ but you can match regex with regex too (It’s long as hell though, relatively)

    You can try it in your browser at: https://regex101.com/

    Idk why they called that field .*regex though, probably cuz it’s fake

    Wait I can write a better regex lol

    Edit: this will match all substrings properly inside that structure, including more regexes, correctly(edit edit: WRONG!): (?<=[\[| ])[^,]+(?=[,|\]])

    Edit edit: It’s all fucked and my brain hurts now because I wanted to match any valid regex inside of that structure, separately

    I will be back with the ultimate regex later, probably recursive and with the caveat that if you want to use comma literals, you will have to escape them, call that shit X-regex (special X.com regex syntax)

    I am going to bed I am so tired

    I’m sorry, there’s no way I can write this in a sane-sounding way, it’s been a journey and I’m probably drastically overcomplicating this

      • PaX [comrade/them, they/them]@hexbear.net
        link
        fedilink
        English
        arrow-up
        2
        ·
        edit-2
        2 months ago

        I should not have said that, I’m sorry I was really tired, but I think it’s also more complicated than no

        Many implementations of “regular expressions” are actually capable of describing more than regular languages

        Like Perl/PCRE’s regular expression parser (which I used to write the above regexes) is capable of recursive evaluation and backreferences and probably other stuff I don’t know about cuz I don’t use it very often

        I don’t actually know if you can or not but yeah

        Tbh, you probably know more about formal language theory than me blob-no-thoughts