All Projects → nisrulz → Validatetor

nisrulz / Validatetor

Licence: apache-2.0
Android library for fast and simple string validation

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to Validatetor

V8n
☑️ JavaScript fluent validation library
Stars: ✭ 3,858 (+2736.76%)
Mutual labels:  validation, library
Swiftcop
SwiftCop is a validation library fully written in Swift and inspired by the clarity of Ruby On Rails Active Record validations.
Stars: ✭ 544 (+300%)
Mutual labels:  validation, email-validation
Ustring
The Hoa\Ustring library.
Stars: ✭ 403 (+196.32%)
Mutual labels:  library, string
Svelte Forms Lib
📝. A lightweight library for managing forms in Svelte
Stars: ✭ 238 (+75%)
Mutual labels:  validation, library
Tinystr
A small ASCII-only bounded length string representation.
Stars: ✭ 48 (-64.71%)
Mutual labels:  library, string
NeverBounceAPI-PHP
This package provides convenient methods to integrate the NeverBounce API into your project.
Stars: ✭ 22 (-83.82%)
Mutual labels:  validation, email-validation
Accord
Accord: A sane validation library for Scala
Stars: ✭ 519 (+281.62%)
Mutual labels:  validation, library
Bunny
BunnyJS - Lightweight native (vanilla) JavaScript (JS) and ECMAScript 6 (ES6) browser library, package of small stand-alone components without dependencies: FormData, upload, image preview, HTML5 validation, Autocomplete, Dropdown, Calendar, Datepicker, Ajax, Datatable, Pagination, URL, Template engine, Element positioning, smooth scrolling, routing, inversion of control and more. Simple syntax and architecture. Next generation jQuery and front-end framework. Documentation and examples available.
Stars: ✭ 473 (+247.79%)
Mutual labels:  validation, library
Restless
Express.js api, type safe validations and more
Stars: ✭ 32 (-76.47%)
Mutual labels:  validation, library
Php Confusable Homoglyphs
A PHP port of https://github.com/vhf/confusable_homoglyphs
Stars: ✭ 27 (-80.15%)
Mutual labels:  library, string
Php Validate
Lightweight and feature-rich PHP validation and filtering library. Support scene grouping, pre-filtering, array checking, custom validators, custom messages. 轻量且功能丰富的PHP验证、过滤库。支持场景分组,前置过滤,数组检查,自定义验证器,自定义消息。
Stars: ✭ 225 (+65.44%)
Mutual labels:  validation, library
Inapppy
Python In-app purchase validator for Apple AppStore and GooglePlay.
Stars: ✭ 110 (-19.12%)
Mutual labels:  validation, library
Str
A fast, solid and strong typed string manipulation library with multibyte support
Stars: ✭ 199 (+46.32%)
Mutual labels:  library, string
Easyvalidation
✔️ A text and input validation library in Kotlin for Android
Stars: ✭ 328 (+141.18%)
Mutual labels:  validation, library
Stringplus
Funny and minimal string library for C++ inspired by underscore.string
Stars: ✭ 7 (-94.85%)
Mutual labels:  library, string
Lcformvalidation
Javascript based form validation library, third party library / framework agnostic.
Stars: ✭ 58 (-57.35%)
Mutual labels:  validation, library
Ratifier
Ratifier is a form validation library for Android.
Stars: ✭ 123 (-9.56%)
Mutual labels:  validation, library
Csv2ofx
A Python library and command line tool for converting csv to ofx and qif files
Stars: ✭ 133 (-2.21%)
Mutual labels:  library
Simplecli
Command Line Interface Library for Arduino
Stars: ✭ 135 (-0.74%)
Mutual labels:  library
C standard lib
source code of The Standard C Library, by Plauger
Stars: ✭ 133 (-2.21%)
Mutual labels:  library

Android library for fast and simple string validation.

Built with ❤︎ by Nishant Srivastava and contributors


Including in your project

ValidateTor is available in Jcenter, so getting it as simple as adding it as a dependency

implementation 'com.github.nisrulz:validatetor:{latest version}'

where {latest version} corresponds to published version in Download

Usage

  1. Init ValidateTor

    Java

    ValidateTor validateTor = new ValidateTor();
    

    Kotlin

    var validateTor = ValidateTor();
    
  2. Validate string against the type of validation method from ValidateTor

    // i.e To validate a password string
    EditText edt_password = findViewById(R.id.edt_password);
    String str = edt_password.getText().toString();
    
    // Check if password field is empty
    if (validateTor.isEmpty(str)) {
      edt_password.setError("Field is empty!");
    }
    
    // Check password string to be of minimum length of 8 characters and should have
    // atleast 1 digit, 1 upppercase letter and 1 special character
    if (validateTor.isAtleastLength(str, 8)
        && validateTor.hasAtleastOneDigit(str)
        && validateTor.hasAtleastOneUppercaseCharacter(str)
        && validateTor.hasAtleastOneSpecialCharacter(str)) {
    
        // Valid Password
    
    } else {
       // Invalid Password, handle in ui
        edt_password.setError("Password needs to be of minimum length of 8 characters and should have " +
          "atleast 1 digit, 1 upppercase letter and 1 special character ");
    }
    

    ... other possible validations are as below:

    Method Name Description Return Type
    containsSubstring(String str, String seed) Check if the string contains the seed boolean
    isAlpha(String str) Check if the string contains only letters boolean
    isAlphanumeric(String str) Check if the string contains only letters and numbers boolean
    isBoolean(String str) Check if a string is a boolean boolean
    isIPAddress(String str) Check if the string is a ip address boolean
    isEmail(String str) Check if the string is a email address boolean
    isPhoneNumber(String str) Check if the string is a US phone number boolean
    isEmpty(String str) Check if the string has a length of zero boolean
    isBase64(String str) Check if a string is base64 encoded boolean
    isDecimal(String str) Check if the string represents a decimal number, such as 0.1, .3, 1.1, 1.00003, 4.0, etc boolean
    isAtleastLength(String str, int len) Check if the string is of atleast the specified length boolean
    isAtMostLength(String str, int len) Check if the string is of atmost the specified length boolean
    isLowercase(String str) Check if the string is all lowercase boolean
    isUppercase(String str) Check if the string is all uppercase boolean
    isValidMD5(String str) Check if the string is a valid MD5 hash boolean
    isNumeric(String str) Check if the string contains only numbers boolean
    isMACAddress(String str) Check if the string is a MAC address boolean
    isJSON(String str) Check if the string is valid JSON boolean
    isInteger(String str) Check if the string is an integer boolean
    isIn(String str, String[] values) Check if the string is present in an array of allowed values boolean
    isHexadecimal(String str) Check if the string is a hexadecimal number boolean
    isPinCode(String str) Check if the string is a pincode boolean
    isHexColor(String str) Check if the string is a hexadecimal color boolean
    hasAtleastOneDigit(String str) Check if the string has atleast one digit boolean
    hasAtleastOneLetter(String str) Check if the string has atleast one letter boolean
    hasAtleastOneLowercaseCharacter(String str) Check if the string has atleast one lowercase character boolean
    hasAtleastOneUppercaseCharacter(String str) Check if the string has atleast one uppercase character boolean
    hasAtleastOneSpecialCharacter(String str) Check if the string has atleast one special character boolean
    validateCreditCard(String str) Check if the string is a valid credit card number boolean
    getCreditCardInfo(String str) Get CreditCard information from string CardInformation

Extending ValidateTor

If you wish to extend ValidateTor, use the RegexMatcher class. Create your own regex matchers by passing in a valid regex string to validate() or find()

Method Name Description Return Type
validate(String dataStr, String regex) Validate string against a regex boolean
validate(String dataStr, Pattern pattern) Validate string against a pattern boolean
find(String dataStr, String regex) Find in string against a regex boolean
find(String dataStr, Pattern pattern) Find in string against a pattern boolean

License

Licensed under the Apache License, Version 2.0, click here for the full license.

Author & support

This project was created by Nishant Srivastava but hopefully developed and maintained by many others. See the the list of contributors here.

If you appreciate my work, consider buying me a cup of ☕️ to keep me recharged 🤘

I love using my work and I'm available for contract work. Freelancing helps to maintain and keep my open source projects up to date!

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].