matheusgontijo

matheusgontijo

Validation - library with +25 fully tested rules. +40 coming up soon!

Hey dear #AlchemistFriends! I’m creating a :heavy_check_mark::heavy_check_mark: validation engine :heavy_check_mark::heavy_check_mark:, in order to put several day-to-day validation rules all together!!!
If you folks could take a look real quick and provide me some feedback, that would be just fantastic to listen from you :+1::+1::+1:

Some validation rules for instance: Email, Credit Card, Barcode, IBAN, WordCount, PostalCode (us, uk, br…), CountryCode, MacAddress… and +65 other ;- )

P.S.: I’m very-very-very new to the Elixir ecosystem. Literally just 2 weeks learning the language & writing code. Please :pray::pray: be a bit merciful (hehe). Thanks for your understanding.

Most Liked

hauleth

hauleth

Just to point out, while it is deprecated it is perfectly valid email:

foo(@)@baz.com

And I believe your regex will mark it as invalid. You have 2 options how to approach such data as this one:

  • Strictly follow RFC2822 (but for example use flags to disallow some features like comments)
  • Use HTML5 default regex, which is not correct, but at least it will match the same expectations as browser does

Otherwise it ends somewhere in between and can be a little bit confusing (ignoring fact that such long regex is very easy to abuse and force engine to do matching in O(n^2)).

EDIT:

Also it is hard to tell in your alphanumeric/alpha/etc. work within Unicode groups or not. Is string ٠ numeric or not? This character is U+0660 Arabic-Indic Digit Zero, so it is digit, but I think that You do not expected that.

Where Next?

Popular in Libraries Top

josevalim
Hi everyone, We would like to announce that Plataformatec is working on a new MySQL driver called MyXQL. Our goal is to eventually integ...
New
devonestes
Introducing assertions, the library that helps you write really great test assertions! GitHub: https://github.com/devonestes/assertions ...
New
tmbb
I’ve published the first version of my Makeup library. It’s a syntax highlighter for Elixir in the spirit of Pygments, Currently it highl...
New
Qqwy
Hello everyone, I wrote a small library today called MapDiff. It returns a map listing the (smallest amount of) changes to get from map...
New
tmbb
PhoenixWS - Websockets over Phoenix Channels Source code on Github here: https://github.com/tmbb/phoenix_ws Phoenix channels are a great...
New
msaraiva
Surface is an experimental library built on top of Phoenix LiveView and its new LiveComponent API that aims to provide a more declarative...
564 42633 214
New
ericlathrop
I built a silly site for Halloween that uses Phoenix Channels on the backend, and React on the frontend. I had many problems integrating ...
New
bryanjos
Hi, I just published version 0.23.0 of Elixirscript. Most of the changes are around JavaScript interop now that Elixirscript uses the ...
New
bryanjos
Hi, I wanted share a small library we at Revelry Labs made for rendering react components from the server side. There are instructions fo...
New
ostinelli
Let’s write a database! Well not really, but I think it’s a little sad that there doesn’t seem to be a simple in-memory distributed KV da...
New

Other popular topics Top

sergio
In Ruby, I can go: User.find_by(email: "foobar@email.com").update(email: "hello@email.com") How can I do something similar in Elixir? ...
New
dotdotdotPaul
Okay, I'm having a heck of a time trying to figure out how to best handle the validation of belongs_to associations in Ecto. I'm sure I'...
New
Tee
can someone please explain to me how Enum.reduce works with maps
New
JorisKok
I have a server on AWS, and was running a load test using artillery. When looking at the Phoenix dashboard I see the Ports going to 100% ...
New
joaquinalcerro
Hi there, I am working with Ecto-Postgresql and I need to call all of the records from a specific table but the table has 40,000 record...
New
itssasanka
Hi all, Trying to get some more clarity over utc_datetime and naive_datetime for Ecto: https://hexdocs.pm/ecto/Ecto.Schema.html#module-...
New
KronicDeth
Elixir plugin for JetBrain’s IntelliJ Platform (including Rubymine) This is a plugin that adds support for Elixir to JetBrains IntelliJ...
289 35421 110
New
mgjohns61585
Could someone help me? I'm making my first elixir program, number guessing game. I can't figure out how to convert the user's guess from ...
New
chensan
I have a User schema with a :from_id field set to type :string: defmodule TweetBot.Repo.Migrations.CreateUsers do use Ecto.Migration ...
New
shahryarjb
Hello, I have map which I want to convert it to string like this: the map: %{last_name: "tavakkoli", name: "shahryar"} the string I ne...
New

Sub Categories:

We're in Beta

About us Mission Statement