Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/tylerbarker/verbalex
A library for creating complex, composable regular expressions with the reader & writer in mind. 🔍
https://github.com/tylerbarker/verbalex
elixir pcre-regex regex regular-expressions verbal-expressions
Last synced: about 1 month ago
JSON representation
A library for creating complex, composable regular expressions with the reader & writer in mind. 🔍
- Host: GitHub
- URL: https://github.com/tylerbarker/verbalex
- Owner: tylerbarker
- License: apache-2.0
- Created: 2019-04-19T13:55:31.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2019-07-20T12:43:45.000Z (over 5 years ago)
- Last Synced: 2024-09-18T20:46:55.062Z (3 months ago)
- Topics: elixir, pcre-regex, regex, regular-expressions, verbal-expressions
- Language: Elixir
- Homepage: https://hex.pm/packages/verbalex
- Size: 17.6 KB
- Stars: 28
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Verbalex
[![Hex pm](http://img.shields.io/hexpm/v/verbalex.svg?style=flat)](https://hex.pm/packages/verbalex)
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](https://hexdocs.pm/elixir/Regex.html) module for operating on regex. Instead, it focuses only on building the `~r/regexes/` themselves.```elixir
alias Verbalex, as: Vlxprotocols = ""
|> Vlx.find("http")
|> Vlx.maybe("s")
|> Vlx.then("://")
|> Vlx.capture_as("protocols")
|> Regex.compile!()# ~r/(?(?:http)s?(?::\/\/))/
Regex.named_captures(protocols, "https://github.com/tylerbarker")
# %{"protocols" => "https://"}
```## Installation
```elixir
def deps do
[
{:verbalex, "~> 0.3.0"}
]
end
```## Docs
Documentation can be found at [https://hexdocs.pm/verbalex](https://hexdocs.pm/verbalex).
## Acknowledgements
Verbalex is essentially an Elixir port of the popular [Verbal Expressions](https://github.com/VerbalExpressions) family of libraries, while also taking some inspiration from [Simple Regex](https://simple-regex.com/).
Thanks to Max Szengal for laying down the groundwork in 2013 with [ElixirVerbalExpressions](https://github.com/VerbalExpressions/ElixirVerbalExpressions).
## Contributing
For issues, comments or feedback please first [create an issue](https://github.com/tylerbarker/verbalex/issues).