Socket
Socket
Sign inDemoInstall

@absolunet/capturing-group-values

Package Overview
Dependencies
8
Maintainers
3
Versions
1
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @absolunet/capturing-group-values

Extracts capturing group values via a regular expression


Version published
Weekly downloads
2
decreased by-71.43%
Maintainers
3
Created
Weekly downloads
 

Changelog

Source

[1.0.0] - 2019-11-13

Added

  • Initial

Readme

Source

@absolunet/capturing-group-values

npm npm dependencies npms Travis CI

Extracts capturing group values via a regular expression

Install

$ npm install @absolunet/capturing-group-values

Usage

import capturingGroupValues from '@absolunet/capturing-group-values';

const pattern = /(?<alpha>[a-z]+)?:(?<num>\d+)?/u;

console.log(capturingGroupValues('',        pattern));  // {}
console.log(capturingGroupValues(':',       pattern));  // {}
console.log(capturingGroupValues('abc',     pattern));  // {}
console.log(capturingGroupValues('123',     pattern));  // {}
console.log(capturingGroupValues('abc:xyz', pattern));  // { alpha: 'abc' }
console.log(capturingGroupValues('123:789', pattern));  // { num: '789' }
console.log(capturingGroupValues('abc:789', pattern));  // { alpha: 'abc', num: '789' }

Documentation

View documentation



License

MIT © Absolunet

Keywords

FAQs

Last updated on 13 Nov 2019

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