mathieuprog
This library allows you to get all the strings that a regex can match.
Examples:
import RegexToStrings
regex_to_strings("11|2[25]2") == {:ok, ["11", "222", "252"]}
regex_to_strings!("8(024|53)9") == ["80249", "8539"]
regex_to_strings!("(16|7?[56])24") == ["1624", "524", "7524", "624", "7624"]
regex_to_strings!("1[03-59]") == ["10", "13", "14", "15", "19"]
regex_to_strings("1.+2") == :unsupported_regex
regex_to_strings!("1.+2") # RuntimeError: unsupported metacharacter "."
Trending in Announcing
Flop is an Elixir library that applies filtering, ordering and pagination parameters to your Ecto queries.
offset-based pagination with...
New
I needed to reuse React components from my Chrome extension in my Phoenix/LiveView backend. I noticed that for Svelte/Vue, there are live...
New
I released Doggo, a collection of unstyled Phoenix components.
https://github.com/woylie/doggo
Features
Unstyled Phoenix components....
New
Edit: 2026 May 15 - This post is archived.
Mob is alive!!
Main docs: mob v0.7.11 — Documentation
A bit of explanation for the slightly c...
New
Hey, I’m Jesse and I’m the main contributor behind Dexter, a full-featured, lightning-fast Elixir LSP optimized for large codebases. It s...
New
Hi there! We created Gust: A task orchestrator inspired by Airflow.
For those who have never heard about Aiflow, it’s a Python-based wor...
New
Hello
Published a new library - ProcessHub!
ProcessHub is a library designed to manage process distribution within the Elixir cluster. ...
New
Other Trending Topics
I am happy to introduce the very α version of the new programming language compiled to BEAM.
Welcome Cure.
It has literally three kille...
New
Hi everyone!
The first release candidate for the Expert language server project is now available!
We’ve published a press release detai...
New
With AI doing more of the implementation work, I’ve been wondering how much coding I should deliberately keep doing myself.
My main conc...
New
This showed up on my feed.. anyone heard of it? Just hype?
Ox Alpha is a reasoning model designed for coding, sustained ag...
New
Hey folks,
I just published a post about Hologram’s funding and where the project goes next - the short version:
Curiosum as Main Spons...
New
:microphone: ElixirConf 2026 - Call for Talks is open!
We’re heading to Chicago :united_states:
:round_pushpin: In person + virtual
:d...
New
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #library
- #deployment
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #elixirconf
- #channels
- #exunit
- #discussion
- #code-sync
- #podcasts
- #javascript
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #ai
- #elixirconf-us
- #blog-post
- #elixir-ls
- #phoenix_html
- #iex
- #graphql
- #genstage
- #websockets
- #supervisor
- #advent-of-code
- #distillery
- #processes
- #api
- #forms
- #elixirconf-eu
- #metaprogramming
- #hex










Showing Posts 1 to 5- Show Best Posts
- Show All (oldest first)
- Show All (newest first)
a8t
Aren’t there infinitely many matches in some (most) cases?
Nicd
Can you add a link to the library?
mathieuprog
Oops, ty! Done!
Ty updated the examples to reflect that:)
dimitarvp
Maybe you should rebrand this library to something like
string_generatorbecause technically you are not actually supporting regexes. You are supporting a reduced subset of them.mathieuprog
The original use case is generating a list of possible values from a regex, so I keep the name because personally my goal was not to generate strings.
For example a Jamaican international number starts with “1” and then “658|876” according to Google’s libphonenumber. This library allows me to have the list of the possible values, i.e. “1658”, “1876”.
However it’s true that it could be used to generate a non-trivial series of numbers/strings:)