Thanks to visit codestin.com
Credit goes to github.com

Skip to content

CeoFred/regexlite

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

Regex made easy in Go

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Go 100.0%