Socket
Socket
Sign inDemoInstall

regex-match-all

Package Overview
Dependencies
0
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    regex-match-all

PHP-like regex match all


Version published
Weekly downloads
2.2K
increased by20.58%
Maintainers
1
Install size
26.9 kB
Created
Weekly downloads
 

Readme

Source

regex-match-all

PHP-like regex match all

Installation

npm install --save regex-match-all

The UMD build is in the dist directory.

Can be used both in node and browser.

Usage

'use strict';

const RegEx = require('../src/RegEx.js');

let text = 'asd12 dsa asd23 dsa asd34 dsa';

console.log(JSON.stringify(
    
    RegEx.matchAll(/asd(\d)(\d)/g, text)
    
, null, 4));

/*
[
    [
        "asd12",
        "asd23",
        "asd34"
    ],
    [
        "1",
        "2"
    ],
    [
        "2",
        "3"
    ],
    [
        "3",
        "4"
    ]
]
*/

console.log(JSON.stringify(
    
    RegEx.matchAll(/asd(\d)(\d)/g, text, RegEx.REGEXP_PATTERN_ORDER)
    
, null, 4));

/*
    Same as above
*/

console.log(
    
    JSON.stringify(RegEx.matchAll(/asd(\d)(\d)/g, text, RegEx.REGEXP_SET_ORDER)
    
, null, 4));

/*
[
    [
        "asd12",
        "1",
        "2"
    ],
    [
        "asd23",
        "2",
        "3"
    ],
    [
        "asd34",
        "3",
        "4"
    ]
]
*/

FAQs

Last updated on 02 Aug 2016

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc