Regex Pronouns?
By Artyom Bologov
I have a friend who lists
vi/vim
as vis pronouns.
It's obviously a programmer joke, but quite an illuminating one.
vi/vim pair is conventionally contracted to vi(m)
shortcut pattern.
Why not apply that regex-y approach to other pronouns?
The syntax I'm suggesting is not necessarily PCRE or POSIX regex. I'm rather suggesting a sloppy soup of PCRE, UNIX wildcards, and English. Kind of like what programmers do when they talk about *nix, GNU/Linux, or jpe?g.
Binary pronouns are a bad example: /h(e|im)/
might
sound like home,
but it's a pain to type.
Another binary pronoun pair regex that I can come up with is a horrifying /s?her?/
.
Not only it looks out of this world, it's also bad at describing the structure of the pronouns.
Is it she? her? sher? he?
So messy.
Other, less widespread pronouns are much better as regex pronouns:
- Aforementioned vi/vim as
/vim?/
-
/the(y|m)/
,/xe(y|m)/
-
/its?/
- or the "any pronoun" person as
*
Neat, huh?
My pronouns officially are /t?he(y|m)?/
now, what are yours?
Update: thanks to many people on r/programming subreddit, This post now has better regex start/end markers and better expressions for where I had unoptimized syntax. And to people of r/programminghorror, for productive feedback.