Path.wildcard is case-sensitive regardless of platform.

This would be useful on any platform. 

On Monday, August 21, 2017 at 10:54:32 PM UTC+1, Onorio Catenacci wrote:
>
> FWIW, this might have value on *nixes but not on Windows. Windows is 
> case-insensitive in regards to paths.
>
> On Wednesday, August 9, 2017 at 3:36:02 PM UTC-4, Charles Okwuagwu wrote:
>>
>> Hi, 
>>
>> I feel this could be a useful addition to the `Path.wildcard/2` function.
>>
>> How to do case-insensitive search might not be immediately obvious, but 
>> it does have some value.
>>
>> Would a PR for this be welcome?
>>
>> (https://stackoverflow.com/a/45597449/44080)
>>
>> defmodule A do
>>   def case_insensitive_glob(glob) do
>>     Regex.replace(~r/[a-zA-Z]/, glob, fn letter ->
>>       "[#{String.downcase(letter)}#{String.upcase(letter)}]"
>>     end)
>>   endend
>>
>> glob = A.case_insensitive_glob("**/*reAdmE.*") |> 
>> IO.inspectPath.wildcard(glob) |> IO.inspect
>>
>>

-- 
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 elixir-lang-core+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/elixir-lang-core/4d0efbca-53fd-4130-8ada-ea741388d00c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to