easy-regexp_lib

    1.0.4 • Public • Published

    easy-regexp_lib

    version License License size

    it is a library to use regular expression in javascript easier.


    Install

    npm i easy-regexp_lib

    Usage

    import regExpLib from "easy-regexp_lib";
     
    let test = regExpLib('a').then(['a',"b","c"],1).test();  //array['a',"b","c"] has element "a",so return true;
    let test2 = regExpLib('a').then(['v',"d","e"],1).test();  //['v',"d","e"] doesn't include element "a",so return false;

    Event

    1. then(array,int)

    to set the conditions for regular expressions

    regExpLib(inputString).then(conditionArray1,1).then(conditionArray2,2);//The first character have to include 
    //conditionArray1, the second and third characters have to include conditionArray2

    2. test()

    retrun whether the inputStr correspond the condition(true or false)

    regExpLib("1234").then([1],1).then([2,3,4],3).test();//return true;

    3. replace(string)

    Turn the non-correspond part into string

    regExpLib("1234").then([1],1).then([2,3],3).replace(0);//return "1230"

    Install

    npm i easy-regexp_lib

    DownloadsWeekly Downloads

    1

    Version

    1.0.4

    License

    MIT

    Unpacked Size

    13 kB

    Total Files

    10

    Last publish

    Collaborators

    • tp953704