New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

sr_match_capture

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

sr_match_capture

match-capture typescript class

latest
Source
npmnpm
Version
1.1.5
Version published
Maintainers
1
Created
Source

match-capture - apply match instructions, capture match results

matchArr_match function used to match and capture according to array of match instructions.

  import { iMatchCapture, iMatchItem, matchArr_match } from 'sr_match_capture';

  // matchArr. repeating keyword enclosed values.
  const arr: iMatchItem[] = [
    { oper: 'identifier', captureName: 'keyword', zeroMoreWhitespace: true },
    { oper: 'text', text: '(', zeroMoreWhitespace: false },
    { oper: 'repeatBegin', captureName:'args'},
    { oper: 'identifier', doCapture:true, zeroMoreWhitespace: true },
    { oper: 'or' },
    { oper: 'literal', doCapture:true, zeroMoreWhitespace: true },
    { oper: 'repeatMatchText', text:':', zeroMoreWhitespace:true},
    { oper: 'repeatEnd' },
    { oper: 'text', text: ')', zeroMoreWhitespace: true },
  ]
  const text = 'overlay(sditno:jim:25)';
  const match = matchArr_match(text, 0, arr );
  const { keyword, args } = match.capture ;

FAQs

Package last updated on 23 Sep 2023

Did you know?

Socket

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