Skip to content
A library for creating complex, composable regular expressions with the reader & writer in mind. πŸ”
Elixir
Branch: master
Clone or download
Latest commit f0dc0a1 Jul 20, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.semaphore πŸ” v0.1.0-dev Jul 9, 2019
config 🐣init commit Apr 19, 2019
lib add occurs_at_least Jul 20, 2019
test πŸ” v0.1.0-dev Jul 9, 2019
.credo.exs πŸ” v0.1.0-dev Jul 9, 2019
.formatter.exs 🐣init commit Apr 19, 2019
.gitignore πŸ” v0.1.0-dev Jul 9, 2019
LICENSE 🐣init commit Apr 19, 2019
README.md add occurs_at_least Jul 20, 2019
mix.exs add occurs_at_least Jul 20, 2019
mix.lock πŸ” v0.1.0-dev Jul 9, 2019

README.md

Verbalex

Hex pm

Verbalex is a library for creating complex regular expressions with the reader & writer in mind. It does not aim to replace Elixir's already excellent Regex module for operating on regex. Instead, it focuses only on building the ~r/regexes/ themselves.

alias Verbalex, as: Vlx

protocols = ""
  |> Vlx.find("http")
  |> Vlx.maybe("s")
  |> Vlx.then("://")
  |> Vlx.capture_as("protocols")
  |> Regex.compile!()

# ~r/(?<protocols>(?:http)s?(?::\/\/))/

Regex.named_captures(protocols, "https://github.com/tylerbarker")
# %{"protocols" => "https://"}

Installation

def deps do
  [
    {:verbalex, "~> 0.3.0"}
  ]
end

Docs

Documentation can be found at https://hexdocs.pm/verbalex.

Acknowledgements

Verbalex is essentially an Elixir port of the popular Verbal Expressions family of libraries, while also taking some inspiration from Simple Regex.

Thanks to Max Szengal for laying down the groundwork in 2013 with ElixirVerbalExpressions.

Contributing

For issues, comments or feedback please first create an issue.

You can’t perform that action at this time.