Skip to content
This repository has been archived by the owner on Feb 2, 2023. It is now read-only.

Longer tweet codes #107

Open
Llammissar opened this issue Jan 24, 2017 · 2 comments
Open

Longer tweet codes #107

Llammissar opened this issue Jan 24, 2017 · 2 comments

Comments

@Llammissar
Copy link
Contributor

Right now, we have [a-z][0-9]. This is, I sometimes find, not enough. I'd like it if there was either another letter or another digit so I can reply/fav/rt further back in my history.

@funnelfiasco
Copy link
Contributor

640 KB ought to be enough for anybody. I'm definitely open to the idea, but there are a lot of regular expressions that would have to be touched, and there are probably extensions that would break. I'd like to kick this can down the road for a while, but I'm open to someone else jumping in and giving it a go. Before anything gets released, we'd have to shout from the rooftops that we're introducing a potential breakage.

@Llammissar
Copy link
Contributor Author

there are a lot of regular expressions that would have to be touched

Wait, really?

Wyatt looks at the code...

O-okay, yeah. This kind of makes me feel like the parsing needs reworked entirely to separate command and target from the arguments, because stuff like if (m#^/th(read)?\s+(\+\d+\s+)?([zZ]?[a-zA-Z]?[0-9]+)$#) is pretty ugly.

One thing that does come to mind to make this easily configurable is to use qr// operators for the various common chunks and compose them later like so:

$tcre = qr/z?[a-z]?\d+/i;
$pcount = qr/\+\d+\s+/;
# ...
if (m#^/th(read)?\s+(${pcount})?(${tcre})$#)

Aside: now that I look at it closer, the expression for /thread, at least, would already catch codes like m23 or v08 because it's [0-9]+.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants