I'm not too sure if we should have all those many functions should be
added. it could be too many of them, and not easy to extend..
but how about an Unicode.info/1 function, that returns a tuple with
information about that character. such as
iex> Unicode.info("A")
...> {:alphanumeric, :uppercase, :ascii}

It will be easy to improve as we find more information can be added,
such as ISO types and other groups (Specially to encodings we are not
familiar with)

Additionally we could have check?/2 (or some better name probably!)
iex> Unicode.check?("A", :uppercase)
...> true
iex> Unicode.check?("A", :numeric)
...> false


created, but On Tue, 3 May 2016 12:31:44 -0700 (PDT)
[email protected] wrote:

> I have seen multiple people (In the Elixir Slack group 
> <https://elixir-lang.slack.com/archives/general/p1462294660007855>,
> on Reddit 
> <https://www.reddit.com/r/elixir/comments/4h4y4e/whats_missing_from_the_elixir_ecosystem/d2nvbwd>)
>  
> during the last couple of days requiring something that checks if a 
> (possibly long) string contains e.g. only alphanumeric characters.
> 
> It is possible to do this using regular expressions right now:
> ~r/[^[:alnum:]]/u
> 
> but this is very slow.
> 
> My proposal is to add the following boolean functions to the String
> module:
> 
> 
>    -  alphabetic?
>    -  numeric?
>    -  alphanumeric?
>    -  whitespace?
>    -  uppercase? 
>    -  lowercase?
>    -  control_character?
>    
> 
> Function heads for these functions can probably be best generated by
> using compile-time macros similar to what other unicode-based
> functions already use.
> 

-- 
You received this message because you are subscribed to the Google Groups 
"elixir-lang-core" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/elixir-lang-core/20160504042910.57fd86e0.eksperimental%40autistici.org.
For more options, visit https://groups.google.com/d/optout.

Reply via email to