matheusgontijo

matheusgontijo

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

Hey dear #AlchemistFriends! I’m creating a :check_mark::check_mark: validation engine :check_mark::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:

https://github.com/elixir-validation/validation

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 :folded_hands::folded_hands: 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 Announcing Top

danschultzer
In short Plug n’ play OAuth 2.0 provider library. Just set up a resource owner schema with Ecto (your user schema), install the dependen...
New
mischov
import Meeseeks.CSS html = HTTPoison.get!("https://news.ycombinator.com/").body for story <- Meeseeks.all(html, css("tr.athing")) do...
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
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 43622 214
New
Eiji
ExApi is a library that I’m developing now and hope release soon This library will allow to: list all apis list all api implementation...
New
bluzky
You may know https://ui.shadcn.com/, a UI component library for React. I really love it’s design style and components. I’ve built some co...
384 13736 119
New
Flo0807
Hello everyone! I am excited to share our heart project Backpex with you. After building several Phoenix applications, we realized that...
New
OvermindDL1
Been making an MLElixir thing (not released yet…) for fun in spare time in the past day. I’m just trying to see how much I can get an ML...
132 13966 106
New
marcuslankenau
I feel kind of stuck with the absence of a proper xml library for Elixir. Currently I use SweetXML which was ok for me more or less to pa...
New
trisolaran
Hi! :waving_hand: I would like to present LiveSelect, a little library that I wrote to easily add a dynamic selection input to your LV f...
198 10858 107
New

Other popular topics Top

sorentwo
Hello! tl;dr Announcing Oban, an Ecto based job processing library with a focus on reliability and historical observability. After spen...
985 42920 311
New
Harrisonl
We have an ECS cluster with 4 services, where each task joins a single cluster, via discovery ECS discovery service. Currently when I de...
New
Darmani72
If I have a post route which an argument: post /my_post_route/:my_param1, MyController.my_post_handler How would get the post params ...
New
danschultzer
None of the current solutions worked well for me, so I went ahead and built a user management system from scratch. This project took far...
548 29377 241
New
jerry
Good day to you all. I have been struggling to get a query involving like and ilike to work. Can anyone assist me on this, please? pro...
New
nobody
Hi! In PHP: $_SERVER[‘SERVER_ADDR’] - in Elixir? Searched the docs for ip address and the web, no good results. Thanks!
New
shijith.k
I am trying to start a new phoenix project with elixir 1.9, but mix phx.new does not work. It says that ** (Mix) The task "phx.new" could...
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 records...
New
Brian
What is the proper way to load a module from a file in to IEX? In the python world, doing something like this pretty standard: from ....
New
WestKeys
Currently suffering from paralysis by [HTTP client] analysis. This is rather unusual in Elixirland as there tends to be consensus on the ...
New

We're in Beta

About us Mission Statement