1.0.0 • Published 3 years ago

@creepycoder/regexvalidator v1.0.0

Weekly downloads
-
License
CC BY-NC-ND 4.0
Repository
-
Last release
3 years ago

RegEx Validator

This library is small but easy to use. The purpose of this library is to check if a string can be validated via regular expressions.

Validation processes

The code only use regular expressions.

Code sample

This following code is actually how I tested that all seven methods correctly functioned as intended, is also provided in this libery.

import subStringIsValid from './node_modules/@creepycoder/regexvalidator/regexvalidator.js';

console.log( "Testing Condition 1 Passed = " + regExIsValid( "Hallo world" , "^Hallo" ) );
console.log( "Testing Condition 2 Passed = " + !regExIsValid( "Hallo world" , "^world" ) );

The results will look as follows

Testing Condition 1 Passed = true
Testing Condition 2 Passed = true

Function params

@param  {String}  source        The source string to be checked
@param  {String}  expression    The regular expression to use
@return {Boolean}               The string passed/failed validation

Version History

VersionDateRemark
1.0.004 September 2022Official first release

How to install

Run the following command in a terminal or command prompt in the folder you want to install the module to.

npm i @creepycoder/regexvalidator
1.0.0

3 years ago