I can't seem to find it in the #Mastodon docs, but I'm trying to come up with a #regex for validating Mastodon usernames and can't find exactly what's allowed.
-
-
beaware@social.beaware.livereplied to jszym@cosocial.ca last edited by
@jszym that's because Mastodon is probably just using ActivityPub rules that every other ActivityPub software probably also uses.
ActivityPub and WebFinger
Identifiers in ActivityPub tend to be HTTPS URIs. The use of WebFinger (as defined in [RFC7033]) allows for discovery of an actor's identifier given a username and a hostname, which may be more socially salient or otherwise easier to communicate across various contexts and media. The username and hostname are resolved at the WebFinger endpoint of the hostname in order to discover a link to an actor associated with the user's account, and that actor similarly can be back-linked to the username and hostname.
(www.w3.org)
-
jszym@cosocial.careplied to beaware@social.beaware.live last edited by
@BeAware Thank you!!
-
beaware@social.beaware.livereplied to jszym@cosocial.ca last edited by
@jszym no problem. Overall, Mastodon doesn't like to conform to ActovityPub standards, however, if you're ever looking for a way Mastodon does something and they don't have a clear stated way to do it, it's always good to look for ActivityPubs way of doing it.
-
jszym@cosocial.careplied to jszym@cosocial.ca last edited by
@BeAware Just in case anyone else comes across this, I found the regex at the linked page didn't really match super well with the text of the page.
This is one that seems to make a lot more sense to me:
regex101: build, test, and debug regex
Regular expression tester with syntax highlighting, explanation, cheat sheet for PHP/PCRE, Python, GO, JavaScript, Java, C#/.NET, Rust.
regex101 (regex101.com)