This package has been deprecated

Author message:

Not maintained anymore

regexworld

1.0.0 • Public • Published

with an array

const RegexWorld = require("./test.js");

RegexWorld
  .setStr("this is a this test $$ahah$$ you know it a $$lol$$")
  .setRegex([
    RegexWorld.parse("this", "g"),
    /\$\$(.*?)\$\$/gi
  ])
  .regexStart(null, (err, result) => {
    if(err) console.log(err);
    console.log(result);
  })

result:

[ [ [ 'this', index: 0 ], [ 'this', index: 10 ] ],
  [ [ '$$ahah$$', 'ahah', index: 20 ],
    [ '$$lol$$', 'lol', index: 43 ] ] ]

with an obj

const RegexWorld = require("./test.js");

RegexWorld
  .setStr("this is a this test $$ahah$$ you know it a $$lol$$")
  .setRegex({
    "this": RegexWorld.parse("this", "g"),
    "$$": /\$\$(.*?)\$\$/gi
  })
  .regexStart(null, (err, result) => {
    if(err) console.log(err);
    console.log(result);
  })

result:

{ this: [ [ 'this', index: 0 ], [ 'this', index: 10 ] ],
  '$$':
   [ [ '$$ahah$$', 'ahah', index: 20 ],
     [ '$$lol$$', 'lol', index: 43 ] ] }

with a simple regex

const RegexWorld = require("./test.js");

RegexWorld
  .setStr("this is a this test $$ahah$$ you know it a $$lol$$")
  .setRegex(/\$\$(.*?)\$\$/gi)
  .regexStart(null, (err, result) => {
    if(err) console.log(err);
    console.log(result);
  })

result:

[ [ '$$ahah$$', 'ahah', index: 20 ],
  [ '$$lol$$', 'lol', index: 43 ] ]

Readme

Keywords

none

Package Sidebar

Install

npm i regexworld

Weekly Downloads

2

Version

1.0.0

License

ISC

Last publish

Collaborators

  • internalcosmos
  • zelak312