GithubHelp home page GithubHelp logo

regexlite's Introduction

Regex Lite🔥 Twitter Follow

📖Description

regexlite is a Golang utility library designed to simplify the creation and validation of regular expressions.

✨Features

  • Chainable Functions
  • Easy construction of complex regex patterns
  • Built-in validators for common use-cases like email, URL, etc.
  • Customizable and extendable

Installation

go get github.com/Grandbusta/regexlite

🛠️Usage

Here's a quick example to get you started:

package main

import (
	"fmt"

	"github.com/Grandbusta/regexlite"
)

func main() {
	isValidPassword, err := regexlite.Value("Thisisapass&").Min(8).Max(30).HasUpperCase().HasSpecialCharacter().Validate()
	fmt.Println(isValidPassword, err) // returns true or false based on validation. err returns nil or error based on validation
}

📮Available Methods

  • HasText(): Ensures the string contains text (a-z, A-Z).
  • HasNumbers(): Ensures the string contains numbers.
  • HasSpecialCharacter(): Ensures the string contains special characters.
  • Min(length: int): Sets the minimum length of the string.
  • Max(length: int): Sets the maximum length of the string.
  • Validate(): Executes the validation and returns a boolean and error result.
  • HasUpperCase(): Ensures string contains at least one uppercase character.
  • HasLowerCase(): Ensures string contains at least one lowercase character.
  • IsEmail(): Ensures string is a valid email.
  • IsUrl(): Ensures string is a valid url.
  • Contains(substring string): Ensures string contains a substring.

➕Contributing

If you have a suggestion that would make this project better, please fork the repo and create a pull request. Don't forget to give the project a star! Thanks again!

🤓 Author(s)

Olaifa Boluwatife Jonathan Twitter Follow

🔖 License

Distributed under the MIT License. See LICENSE for more information.

regexlite's People

Contributors

amatsagu avatar grandbusta avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.