Skip to content

SylSoft.Utils.Validators is a lightweight .NET library for validating common formats (email, phone, URL) and country-specific data (e.g., CUIL, CPF, NIF), offering offline validation without external services. It's easy to integrate and extend in your projects.

License

Notifications You must be signed in to change notification settings

Sylsoft-Software-Design/SylSoft.Utils.Validators

Repository files navigation

SylSoft.Utils.Validators

A modular, extensible, and lightweight set of validators for .NET developers.
Covers global and country-specific validation rules without relying on any external services.


✨ Features

  • Global validators (Email, IP, URL, GUID, IBAN, etc.)
  • Country-specific validators (Argentina, Brazil, Spain, USA, Mexico, Chile)
  • Fluent and intuitive API
  • Full C# 10+ and .NET 6+ support
  • 100% offline, no external dependencies
  • Designed for extensibility

🚀 Installation

dotnet add package SylSoft.Utils.Validators

Or via NuGet Package Manager:

Install-Package SylSoft.Utils.Validators

📚 Usage

using SylSoft.Utils.Validators;

// Email validation
var emailValidator = ValidatorFactory.Email();
bool isValidEmail = emailValidator.Validate("example@domain.com");

// Validate CUIL (Argentina)
var cuilValidator = ValidatorFactory.CUIL();
bool isValidCuil = cuilValidator.Validate("20-12345678-3");

// Date validations
var dateService = ValidatorFactory.Date();
bool isLeapYear = dateService.IsLeapYear(2024);
bool isFirstDayOfMonth = dateService.IsFirstDayOfMonth(DateTime.Today);

🛆 Available Validators

Global

  • EmailValidator
  • UrlValidator
  • IpValidator
  • PhoneValidator
  • PasswordStrengthValidator
  • GuidValidator
  • IBANValidator
  • CreditCardValidator
  • Base64Validator
  • HexColorValidator
  • AlphanumericValidator
  • NumericValidator
  • LuhnValidator
  • DateValidator (and Date service)

Argentina (WIP)

  • CUILValidator
  • CUITValidator
  • DNIValidator
  • CBUValidator
  • AliasCBUValidator
  • PatenteValidator
  • TelefonoValidator

Brazil (WIP)

  • CPFValidator
  • CNPJValidator

Spain (WIP)

  • NIFValidator
  • NIEValidator
  • CIFValidator

USA (WIP)

  • SSNValidator
  • ZipCodeValidator

Mexico (WIP)

  • RFCValidator
  • CURPValidator
  • CodigoPostalValidator

Chile (WIP)

  • RUTValidator

(WIP) stands for "Work In Progress." It indicates that the validators marked with this label are under development and may not be fully implemented or tested. Users should be aware that these features might change or may not be entirely available in the current version.


🛡️ License

This project is licensed under the MIT License.


❤️ Support

If you find this library useful, consider sponsoring the project to help continue development!
Become a Sponsor ✨


🌍 About

Developed by Cristian M. Zangaro at SylSoft.


LICENSE

MIT License

Copyright (c) 2025 Cristian M. Zangaro

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

About

SylSoft.Utils.Validators is a lightweight .NET library for validating common formats (email, phone, URL) and country-specific data (e.g., CUIL, CPF, NIF), offering offline validation without external services. It's easy to integrate and extend in your projects.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

  •  
  •  

Packages

No packages published

Languages