Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/gniquil/ex_brace_expansion
https://github.com/gniquil/ex_brace_expansion
Last synced: 3 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/gniquil/ex_brace_expansion
- Owner: gniquil
- License: mit
- Created: 2015-04-03T02:20:04.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2020-10-07T19:37:51.000Z (over 4 years ago)
- Last Synced: 2024-09-14T12:42:28.947Z (5 months ago)
- Language: Elixir
- Size: 176 KB
- Stars: 5
- Watchers: 2
- Forks: 5
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
- freaking_awesome_elixir - Elixir - Brace expansion, as known from sh/bash, in Elixir. (Text and Numbers)
- fucking-awesome-elixir - ex_brace_expansion - Brace expansion, as known from sh/bash, in Elixir. (Text and Numbers)
- awesome-elixir - ex_brace_expansion - Brace expansion, as known from sh/bash, in Elixir. (Text and Numbers)
README
ExBraceExpansion
================[Brace expansion](https://www.gnu.org/software/bash/manual/html_node/Brace-Expansion.html), as known from sh/bash, in Elixir. This is a port of [brace-expasion](https://github.com/juliangruber/brace-expansion) javascript project.
## Examples
```elixir
iex> import ExBraceExpansion
niliex> expand("file-{a,b,c}.jpg")
["file-a.jpg", "file-b.jpg", "file-c.jpg"]iex> expand("-v{,,}")
["-v", "-v", "-v"]iex> expand("file{0..2}.jpg")
["file0.jpg", "file1.jpg", "file2.jpg"]iex> expand("file-{a..c}.jpg")
["file-a.jpg", "file-b.jpg", "file-c.jpg"]iex> expand("file{2..0}.jpg")
["file2.jpg", "file1.jpg", "file0.jpg"]iex> expand("file{0..4..2}.jpg")
["file0.jpg", "file2.jpg", "file4.jpg"]iex> expand("file-{a..e..2}.jpg")
["file-a.jpg", "file-c.jpg", "file-e.jpg"]iex> expand("file{00..10..5}.jpg")
["file00.jpg", "file05.jpg", "file10.jpg"]iex> expand("{{A..C},{a..c}}")
["A", "B", "C", "a", "b", "c"]iex> expand("ppp{,config,oe{,conf}}")
["ppp", "pppconfig", "pppoe", "pppoeconf"]
```