Skip to content

Conversation

@miniBill
Copy link
Collaborator

@miniBill miniBill commented Jun 26, 2025

I think "non-word" was not a great wording. I've also added an example to make it clear how it deals (or doesn't deal) with Unicode.

"non-word" kinda makes sense if you look at it from a regex point of view but:

  1. regexes are an implementation details
  2. It's actually [\W_] not [\W]

@miniBill miniBill requested a review from gampleman June 26, 2025 14:09
classify "myLittleCamel.class.name" --> "MyLittleCamelClassName"
classify "München" --> "MNchen"
Copy link
Collaborator

Choose a reason for hiding this comment

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

Hm... is there ever a point where this is desirable behavior? And is there a way to fix it or is this one of those parts of Elm where there isn't really a great workaround?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It's not desirable, no, but we can't fix it without some form of unicode support, and the only current path (elm-unicode) would add an unacceptable size to the bundle.

I prefer to document it rather than leave it as a surprise though.

The "clean" fix would be to have a new version of elm/regex with support for enabling the unicode flag.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Ok thanks for the explanation.

@gampleman gampleman merged commit f765a44 into master Jun 29, 2025
4 checks passed
@gampleman gampleman deleted the improve-doc-for-classify branch June 29, 2025 21:46
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