1.0.0 • Published 3 years ago
@creepycoder/regexvalidator v1.0.0
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
Version | Date | Remark |
---|---|---|
1.0.0 | 04 September 2022 | Official 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