I am unbelievably shit at regex, and I didn’t bother testing this one.
Comment on Fediverse Social Media Guide
flamingos@feddit.uk 2 days ago
^(?:(?:feddit.(?:it|ie|uk|org|de|nl))|(?:lemmy.(?:cafe|ml|ca|org|world|zip|nz))|(?:sh.itjust.works|programming.dev|lemm.ee|sopuli.xyz|jlai.lu|lemmy.blahaj.zone|lemmy.dbzer0.com|aussie.zone|beehaw.org|lemmy.sdf.org|slrpnk.net))$
Shout out to my favourite lemmy instance, shmitjustoworks. Real cool people.
Irelephant@lemm.ee 1 day ago
Irelephant@lemm.ee 1 day ago
^(?:(?:feddit\.(?:it|ie|uk|org|de|nl))|(?:lemmy\.(?:cafe|ml|ca|org|world|zip|nz))|(?:sh\.itjust\.works|programming\.dev|lemm\.ee|sopuli\.xyz|jlai\.lu|lemmy\.blahaj\.zone|lemmy\.dbzer0\.com|aussie\.zone|beehaw\.org|lemmy\.sdf\.org|slrpnk\.net))$
pretty sure this is correct.
flamingos@feddit.uk 1 day ago
Looks correct, but boring as you kept it pretty readable, the total opposite of what a regex should be.
^(?:(?:feddit\.(?:i[te]|uk|org|de|nl))|(?:lemm(?:\.ee|y\.(?:ca(?:fe)?|ml|(?:sdf\.)?org|world|zip|nz|blahaj\.zone|dbzer0\.com)))|(?:sh\.itjust\.works|programming\.dev|sopuli\.xyz|jlai\.lu|aussie\.zone|beehaw\.org|slrpnk\.net))$
Now this is getting there, but to make a real regex, we need to go to Emacs’ syntax:
"^\\(?:\\(?:feddit\\.\\(?:i[te]\\|uk\\|org\\|de\\|nl\\)\\)\\|\\(?:lemm\\(\\.ee\\|y\\.\\(ca\\(?:fe\\)?\\|ml\\|\\(?:sdf\\.\\)org\\|world\\|zip\\|nz\\|blahaj\\.zone\\|dbzer0\\.com?\\)\\)\\)\\|\\(?:sh\\.itjust\\.works\\|sopuli.xyz\\|jlai\\.lu\\|aussie\\.zone\\|beehaw.org\\|slrpnk\\.net\\)\\)$"
I am a weirdo who actually like regexIrelephant@lemm.ee 1 day ago
That is fucked up and its annoying that it works
JcbAzPx@lemmy.world 1 day ago
Regex in a nutshell.