Last active
August 29, 2015 14:04
-
-
Save Gazler/8c893bbcfad2d09a0dd0 to your computer and use it in GitHub Desktop.
Elixir Regex split
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
gazler@gazler-desktop-pc:~/development/elixir/elixir$ iex | |
Erlang/OTP 17 [erts-6.0] [source-07b8f44] [64-bit] [smp:8:8] [async-threads:10] [hipe] [kernel-poll:false] | |
Interactive Elixir (0.14.3) - press Ctrl+C to exit (type h() ENTER for help) | |
iex(1)> Regex.split(~r/(%{[^}]+})/, "%{foo}(%{bar}): %{baz}") | |
["", "%{foo}", "(", "%{bar}", "): ", "%{baz}", ""] | |
gazler@gazler-desktop-pc:~/development/elixir/elixir$ iex | |
Erlang/OTP 17 [erts-6.0] [source-07b8f44] [64-bit] [smp:8:8] [async-threads:10] [hipe] [kernel-poll:false] | |
Interactive Elixir (0.15.0-dev) - press Ctrl+C to exit (type h() ENTER for help) | |
iex(1)> Regex.split(~r/(%{[^}]+})/, "%{foo}(%{bar}): %{baz}") | |
["", "(", "): ", ""] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment