Skip to content

fix: Normalize regex format - #188

Merged
Dadadah merged 2 commits into
stoatchat:mainfrom
Pecacheu:fix/regex
Aug 20, 2026
Merged

fix: Normalize regex format#188
Dadadah merged 2 commits into
stoatchat:mainfrom
Pecacheu:fix/regex

Conversation

@Pecacheu

@Pecacheu Pecacheu commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

Matches the ULID regex format with what for-web uses because I'm pedantic like that and y'all need to use RegEx properly (I need to de-duplicate some of the regex that does the same thing as these strings in for-web too later)

Signed-off-by: Pecacheu <3608878+Pecacheu@users.noreply.github.com>

@amycatgirl amycatgirl left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🐇

@Dadadah

Dadadah commented Aug 19, 2026

Copy link
Copy Markdown
Member

These two regex tests are not the same. The original is omitting I and L, probably for ambiguity reasons.

@Pecacheu

Pecacheu commented Aug 20, 2026

Copy link
Copy Markdown
Contributor Author

These two regex tests are not the same. The original is omitting I and L, probably for ambiguity reasons.

Uh oh
That means the ones in for-web are wrong then

Hmm, looks like it's missing four, in fact: I, L, O, and U. Which makes sense now that I think about it because it is base32... But there's 26 letters in the alphabet, and 10 numbers... So, four letters need to be dropped or else the math wouldn't math. :O

Thanks for noticing this lol
I think the numbers can still become \d though. And I'll refactor for-web to use the same in it's ID-checking regexes.

Comment thread src/lib/regex.ts Outdated
@Pecacheu
Pecacheu force-pushed the fix/regex branch 2 times, most recently from 634bcb7 to ab0d830 Compare August 20, 2026 04:51
Signed-off-by: Pecacheu <3608878+Pecacheu@users.noreply.github.com>
@Dadadah
Dadadah merged commit d435932 into stoatchat:main Aug 20, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants